\input{preamble}

% OK, start here.
%
\begin{document}

\title{Resolution of Surfaces}


\maketitle

\phantomsection
\label{section-phantom}

\tableofcontents

\section{Introduction}
\label{section-introduction}

\noindent
This chapter discusses resolution of singularities of surfaces
following Lipman \cite{Lipman} and mostly following the exposition of
Artin in \cite{Artin-Lipman}. The main result
(Theorem \ref{theorem-resolve}) tells us that a Noetherian
$2$-dimensional scheme $Y$ has a resolution of singularities when
it has a finite normalization $Y^\nu \to Y$ with
finitely many singular points $y_i \in Y^\nu$ and for each $i$ the completion
$\mathcal{O}_{Y^\nu, y_i}^\wedge$ is normal.

\medskip\noindent
To be sure, if $Y$ is a $2$-dimensional scheme of finite type over
a quasi-excellent base ring $R$ (for example a field or a
Dedekind domain with fraction field of characteristic $0$
such as $\mathbf{Z}$) then the normalization of $Y$ is finite,
has finitely many singular points, and the completions of the
local rings are normal. See the discussion in
More on Algebra, Sections
\ref{more-algebra-section-singular-locus},
\ref{more-algebra-section-G-ring}, and
\ref{more-algebra-section-excellent}
and
More on Algebra, Lemma \ref{more-algebra-lemma-normal-goes-up}.
Thus such a $Y$ has a resolution of singularities.

\medskip\noindent
A rough outline of the proof is as follows. Let $A$ be a
Noetherian local domain of dimension $2$. The steps of the proof
are as follows
\begin{enumerate}
\item[N] replace $A$ by its normalization,
\item[V] prove Grauert-Riemenschneider,
\item[B] show there is a maximum $g$ of the lengths of
$H^1(X, \mathcal{O}_X)$ over all normal modifications $X \to \Spec(A)$
and reduce to the case $g = 0$,
\item[R] we say $A$ defines a rational singularity if $g = 0$
and in this case after a finite number of
blowups we may assume $A$ is Gorenstein and $g = 0$,
\item[D] we say $A$ defines a rational double point if
$g = 0$ and $A$ is Gorenstein and in this case we
explicitly resolve singularities.
\end{enumerate}
Each of these steps needs assumptions on the ring $A$.
We will discuss each of these in turn.

\medskip\noindent
Ad N: Here we need to assume that $A$ has a finite normalization
(this is not automatic). Throughout most of the chapter we will
assume that our scheme is Nagata if we need to know some normalization
is finite. However, being Nagata is a slightly stronger condition
than is given to us in the statement of the theorem.
A solution to this (slight) problem would have been to use that
our ring $A$ is formally unramified (i.e., its completion
is reduced) and to use Lemma \ref{lemma-formally-unramified}.
However, the way our proof works, it turns out it is easier to
use Lemma \ref{lemma-normalization-completion}
to lift finiteness of the normalization over the
completion to finiteness of the normalization over $A$.

\medskip\noindent
Ad V: This is Proposition \ref{proposition-Grauert-Riemenschneider}
and it roughly states that for a normal modification $f : X \to \Spec(A)$
one has $R^1f_*\omega_X = 0$ where $\omega_X$ is the dualizing module
of $X/A$ (Remark \ref{remark-dualizing-setup}).
In fact, by duality the result is equivalent to a statement
(Lemma \ref{lemma-R1-injective})
about the object $Rf_*\mathcal{O}_X$ in the {\it derived category} $D(A)$.
Having said this, the proof uses the standard fact that
components of the special fibre have positive conormal
sheaves (Lemma \ref{lemma-nontrivial-normal-bundle}).

\medskip\noindent
Ad B: This is in some sense the most subtle part of the proof.
In the end we only need to use the output of this step when $A$
is a complete Noetherian local ring, although the writeup is a
bit more general. The terminology is set in
Definition \ref{definition-reduce-to-rational}.
If $g$ (as defined above) is bounded, then a straightforward
argument shows that we can find a normal modification $X \to \Spec(A)$
such that all singular points of $X$ are rational singularities, see
Lemma \ref{lemma-reduce-to-rational}. We show that given a finite extension
$A \subset B$, then $g$ is bounded for $B$ if it is bounded for $A$
in the following two cases: (1) if the fraction field extension
is separable, see Lemma \ref{lemma-reduce-to-rational} and
(2) if the fraction field extension has degree $p$,
the characteristic is $p$, and $A$ is regular and complete, see
Lemma \ref{lemma-go-up-degree-p}.

\medskip\noindent
Ad R: Here we reduce the case $g = 0$ to the Gorenstein case.
A marvellous fact, which makes everything work, is that the
blowing up of a rational surface singularity is normal, see
Lemma \ref{lemma-blow-up-normal-rational}.

\medskip\noindent
Ad D: The resolution of rational double points proceeds more or
less by hand, see
Section \ref{section-rational-double-points}.
A rational double point
is a hypersurface singularity (this is true but we don't prove it
as we don't need it). The local equation looks like
$$
a_{11} x_1^2 + a_{12} x_1x_2 + a_{13}x_1x_3 + a_{22} x_2^2 +
a_{23} x_2x_3 + a_{33} x_3^2 =
\sum a_{ijk} x_ix_jx_k
$$
Using that the quadratic part cannot be zero because the multiplicity
is $2$ and remains $2$ after any blowup and the fact that every blowup
is normal one quickly achieves a resolution. One twist is that we
do not have an invariant which decreases every blowup, but we rely
on the material on formal arcs from Section \ref{section-arcs}
to demonstrate that the process stops.

\medskip\noindent
To put everything together some additional work has
to be done. The main kink is that we want to lift a resolution
of the completion $A^\wedge$ to a resolution of $\Spec(A)$.
In order to do this we first show that if a resolution exists,
then there is a resolution by normalized blowups
(Lemma \ref{lemma-existence-implies-existence-by-normalized-blowing-ups}).
A sequence of normalized blowups can be lifted from the completion
by Lemma \ref{lemma-normalized-blowup-completion}.
We then use this even in the proof of resolution of complete
local rings $A$ because our strategy works by induction
on the degree of a finite inclusion $A_0 \subset A$ with
$A_0$ regular, see Lemma \ref{lemma-resolve-complete}.
With a stronger result in B (such as is proved in Lipman's paper)
this step could be avoided.




\section{A trace map in positive characteristic}
\label{section-trace}

\noindent
Some of the results in this section can be deduced from the much more
general discussion on traces on differential forms in
de Rham Cohomology, Section \ref{derham-section-trace}.
See Remark \ref{remark-compare-Garel} for a discussion.

\medskip\noindent
We fix a prime number $p$. Let $R$ be an $\mathbf{F}_p$-algebra.
Given an $a \in R$ set $S = R[x]/(x^p - a)$. Define an $R$-linear map
$$
\text{Tr}_x : \Omega_{S/R} \longrightarrow \Omega_R
$$
by the rule
$$
x^i\text{d}x \longmapsto
\left\{
\begin{matrix}
0 & \text{if} & 0 \leq i \leq p - 2, \\
\text{d}a & \text{if} & i = p - 1
\end{matrix}
\right.
$$
This makes sense as $\Omega_{S/R}$ is a free $R$-module with
basis $x^i\text{d}x$, $0 \leq i \leq p - 1$.
The following lemma implies that the trace map is well defined,
i.e., independent of the choice of the coordinate $x$.

\begin{lemma}
\label{lemma-trace-well-defined}
Let $\varphi : R[x]/(x^p - a) \to R[y]/(y^p - b)$ be an $R$-algebra
homomorphism. Then $\text{Tr}_x = \text{Tr}_y \circ \varphi$.
\end{lemma}

\begin{proof}
Say $\varphi(x) = \lambda_0 + \lambda_1 y + \ldots + \lambda_{p - 1}y^{p - 1}$
with $\lambda_i \in R$. The condition that mapping $x$ to
$\lambda_0 + \lambda_1 y + \ldots + \lambda_{p - 1}y^{p - 1}$
induces an $R$-algebra homomorphism $R[x]/(x^p - a) \to R[y]/(y^p - b)$
is equivalent to the condition that
$$
a = \lambda_0^p + \lambda_1^p b + \ldots + \lambda_{p - 1}^pb^{p - 1}
$$
in the ring $R$. Consider the polynomial ring
$$
R_{univ} = \mathbf{F}_p[b, \lambda_0, \ldots, \lambda_{p - 1}]
$$
with the element
$a = \lambda_0^p + \lambda_1^p b + \ldots + \lambda_{p - 1}^pb^{p - 1}$
Consider the universal algebra map
$\varphi_{univ} : R_{univ}[x]/(x^p - a) \to R_{univ}[y]/(y^p - b)$
given by mapping $x$ to
$\lambda_0 + \lambda_1 y + \ldots + \lambda_{p - 1}y^{p - 1}$.
We obtain a canonical map
$$
R_{univ} \longrightarrow R
$$
sending $b, \lambda_i$ to $b, \lambda_i$. By construction we get a
commutative diagram
$$
\xymatrix{
R_{univ}[x]/(x^p - a) \ar[r] \ar[d]_{\varphi_{univ}} &
R[x]/(x^p - a) \ar[d]^\varphi \\
R_{univ}[y]/(y^p - b) \ar[r] & R[y]/(y^p - b)
}
$$
and the horizontal arrows are compatible with the trace maps. Hence it
suffices to prove the lemma for the map $\varphi_{univ}$. Thus we may
assume $R = \mathbf{F}_p[b, \lambda_0, \ldots, \lambda_{p - 1}]$
is a polynomial ring. We will check the lemma holds in this case
by evaluating
$\text{Tr}_y(\varphi(x)^i\text{d}\varphi(x))$ for $i = 0 , \ldots, p - 1$.

\medskip\noindent
The case $0 \leq i \leq p - 2$. Expand
$$
(\lambda_0 + \lambda_1 y + \ldots + \lambda_{p - 1}y^{p - 1})^i
(\lambda_1 + 2 \lambda_2 y + \ldots + (p - 1)\lambda_{p - 1}y^{p - 2})
$$
in the ring $R[y]/(y^p - b)$. We have to show that the coefficient
of $y^{p - 1}$ is zero. For this it suffices to show that
the expression above as a polynomial in $y$ has vanishing
coefficients in front of the powers $y^{pk - 1}$.
Then we write our polynomial as
$$
\frac{\text{d}}{(i + 1)\text{d}y}
(\lambda_0 + \lambda_1 y + \ldots + \lambda_{p - 1}y^{p - 1})^{i + 1}
$$
and indeed the coefficients of $y^{kp - 1}$ are all zero.

\medskip\noindent
The case $i = p - 1$. Expand
$$
(\lambda_0 + \lambda_1 y + \ldots + \lambda_{p - 1}y^{p - 1})^{p - 1}
(\lambda_1 + 2 \lambda_2 y + \ldots + (p - 1)\lambda_{p - 1}y^{p - 2})
$$
in the ring $R[y]/(y^p - b)$. To finish the proof we have to show that
the coefficient of $y^{p - 1}$ times $\text{d}b$ is $\text{d}a$.
Here we use that $R$ is $S/pS$ where
$S = \mathbf{Z}[b, \lambda_0, \ldots, \lambda_{p - 1}]$.
Then the above, as a polynomial in $y$, is equal to
$$
\frac{\text{d}}{p\text{d}y}
(\lambda_0 + \lambda_1 y + \ldots + \lambda_{p - 1}y^{p - 1})^p
$$
Since $\frac{\text{d}}{\text{d}y}(y^{pk}) = pk y^{pk - 1}$
it suffices to understand the coefficients of $y^{pk}$ in the polynomial
$(\lambda_0 + \lambda_1 y + \ldots + \lambda_{p - 1}y^{p - 1})^p$
modulo $p$. The sum of these terms gives
$$
\lambda_0^p + \lambda_1^py^p + \ldots + \lambda_{p - 1}^py^{p(p - 1)}
\bmod p
$$
Whence we see that we obtain after applying the operator
$\frac{\text{d}}{p\text{d}y}$ and after reducing modulo $y^p - b$
the value
$$
\lambda_1^p + 2\lambda_2^pb + \ldots + (p - 1)\lambda_{p - 1}b^{p - 2}
$$
for the coefficient of $y^{p - 1}$ we wanted to compute. Now because
$a = \lambda_0^p + \lambda_1^p b + \ldots + \lambda_{p - 1}^pb^{p - 1}$
in $R$ we obtain that
$$
\text{d}a = (\lambda_1^p  + 2 \lambda_2^p b + \ldots +
(p - 1) \lambda_{p - 1}^p b^{p - 2}) \text{d}b
$$
in $R$. This proves that the coefficient of $y^{p - 1}$ is as desired.
\end{proof}

\begin{lemma}
\label{lemma-trace-higher}
Let $\mathbf{F}_p \subset \Lambda \subset R \subset S$ be ring extensions
and assume that $S$ is isomorphic to $R[x]/(x^p - a)$ for some $a \in R$.
Then there are canonical $R$-linear maps
$$
\text{Tr} :
\Omega^{t + 1}_{S/\Lambda}
\longrightarrow
\Omega_{R/\Lambda}^{t + 1}
$$
for $t \geq 0$ such that
$$
\eta_1 \wedge \ldots \wedge \eta_t \wedge x^i\text{d}x
\longmapsto
\left\{
\begin{matrix}
0 & \text{if} & 0 \leq i \leq p - 2, \\
\eta_1 \wedge \ldots \wedge \eta_t \wedge \text{d}a & \text{if} & i = p - 1
\end{matrix}
\right.
$$
for $\eta_i \in \Omega_{R/\Lambda}$ and such that $\text{Tr}$ annihilates the
image of
$S \otimes_R \Omega_{R/\Lambda}^{t + 1} \to \Omega_{S/\Lambda}^{t + 1}$.
\end{lemma}

\begin{proof}
For $t = 0$ we use the composition
$$
\Omega_{S/\Lambda} \to \Omega_{S/R} \to \Omega_R \to \Omega_{R/\Lambda}
$$
where the second map is Lemma \ref{lemma-trace-well-defined}.
There is an exact sequence
$$
H_1(L_{S/R}) \xrightarrow{\delta} \Omega_{R/\Lambda} \otimes_R S \to
\Omega_{S/\Lambda} \to \Omega_{S/R} \to 0
$$
(Algebra, Lemma \ref{algebra-lemma-exact-sequence-NL}).
The module $\Omega_{S/R}$ is free over $S$ with basis $\text{d}x$
and the module $H_1(L_{S/R})$ is free over $S$ with basis $x^p - a$
which $\delta$ maps to $-\text{d}a \otimes 1$ in
$\Omega_{R/\Lambda} \otimes_R S$. In particular, if we set
$$
M = \Coker(R \to \Omega_{R/\Lambda}, 1 \mapsto -\text{d}a)
$$
then we see that $\Coker(\delta) = M \otimes_R S$. We obtain a
canonical map
$$
\Omega^{t + 1}_{S/\Lambda} \to
\wedge_S^t(\Coker(\delta)) \otimes_S \Omega_{S/R} =
\wedge^t_R(M) \otimes_R \Omega_{S/R}
$$
Now, since the image of the map
$\text{Tr} : \Omega_{S/R} \to \Omega_{R/\Lambda}$
of Lemma \ref{lemma-trace-well-defined} is contained in $R\text{d}a$ we
see that wedging with an element in the image annihilates $\text{d}a$.
Hence there is a canonical map
$$
\wedge^t_R(M) \otimes_R \Omega_{S/R} \to \Omega_{R/\Lambda}^{t + 1}
$$
mapping
$\overline{\eta}_1 \wedge \ldots \wedge \overline{\eta}_t \wedge \omega$
to $\eta_1 \wedge \ldots \wedge \eta_t \wedge \text{Tr}(\omega)$.
\end{proof}

\begin{remark}
\label{remark-compare-Garel}
Let $\mathbf{F}_p \subset \Lambda \subset R \subset S$ and $\text{Tr}$
be as in Lemma \ref{lemma-trace-higher}. By
de Rham Cohomology, Proposition \ref{derham-proposition-Garel}
there is a canonical map of complexes
$$
\Theta_{S/R} :
\Omega_{S/\Lambda}^\bullet
\longrightarrow
\Omega_{R/\Lambda}^\bullet
$$
The computation in de Rham Cohomology, Example \ref{derham-example-Garel}
shows that $\Theta_{S/R}(x^i \text{d}x) = \text{Tr}_x(x^i\text{d}x)$
for all $i$. Since $\text{Trace}_{S/R} = \Theta^0_{S/R}$
is identically zero and since
$$
\Theta_{S/R}(a \wedge b) = a \wedge \Theta_{S/R}(b)
$$
for $a \in \Omega^i_{R/\Lambda}$ and $b \in \Omega^j_{S/\Lambda}$
it follows that $\text{Tr} = \Theta_{S/R}$. The advantage of using $\text{Tr}$
is that it is a good deal more elementary to construct.
\end{remark}

\begin{lemma}
\label{lemma-trace-extends}
Let $S$ be a scheme over $\mathbf{F}_p$. Let $f : Y \to X$ be a finite morphism
of Noetherian normal integral schemes over $S$. Assume
\begin{enumerate}
\item the extension of function fields is purely inseparable of degree $p$, and
\item $\Omega_{X/S}$ is a coherent $\mathcal{O}_X$-module (for example
if $X$ is of finite type over $S$).
\end{enumerate}
For $i \geq 1$ there is a canonical map
$$
\text{Tr} : f_*\Omega^i_{Y/S} \longrightarrow (\Omega_{X/S}^i)^{**}
$$
whose stalk in the generic point of $X$ recovers the trace map of
Lemma \ref{lemma-trace-higher}.
\end{lemma}

\begin{proof}
The exact sequence $f^*\Omega_{X/S} \to \Omega_{Y/S} \to \Omega_{Y/X} \to 0$
shows that $\Omega_{Y/S}$ and hence $f_*\Omega_{Y/S}$ are coherent modules
as well. Thus it suffices to prove the trace map in the generic point
extends to stalks at $x \in X$ with $\dim(\mathcal{O}_{X, x}) = 1$, see
Divisors, Lemma \ref{divisors-lemma-describe-reflexive-hull}.
Thus we reduce to the case discussed in the next paragraph.

\medskip\noindent
Assume $X = \Spec(A)$ and $Y = \Spec(B)$ with $A$ a discrete valuation
ring and $B$ finite over $A$. Since the induced extension $L/K$
of fraction fields is purely inseparable, we see that $B$ is local too.
Hence $B$ is a discrete valuation ring too. Then either
\begin{enumerate}
\item $B/A$ has ramification index $p$ and hence $B = A[x]/(x^p - a)$
where $a \in A$ is a uniformizer, or
\item $\mathfrak m_B = \mathfrak m_A B$ and the residue field
$B/\mathfrak m_A B$ is purely inseparable of degree $p$ over
$\kappa_A = A/\mathfrak m_A$.
Choose any $x \in B$ whose residue class is not in $\kappa_A$
and then we'll have $B = A[x]/(x^p - a)$ where $a \in A$ is
a unit.
\end{enumerate}
Let $\Spec(\Lambda) \subset S$ be an affine open such that
$X$ maps into $\Spec(\Lambda)$. Then we can apply
Lemma \ref{lemma-trace-higher}
to see that the trace map extends to
$\Omega^i_{B/\Lambda} \to \Omega^i_{A/\Lambda}$
for all $i \geq 1$.
\end{proof}


















\section{Quadratic transformations}
\label{section-quadratic}

\noindent
In this section we study what happens when we blow up a nonsingular point
on a surface. We hesitate the formally define such a morphism as a
{\it quadratic transformation} as on the one hand often other names are
used and on the other hand the phrase ``quadratic transformation'' is
sometimes used with a different meaning.

\begin{lemma}
\label{lemma-blowup}
Let $(A, \mathfrak m, \kappa)$ be a regular local ring of dimension $2$.
Let $f : X \to S = \Spec(A)$ be the blowing up of $A$ in $\mathfrak m$
wotj exceptional divisor $E$. There is a closed immersion
$$
r : X \longrightarrow \mathbf{P}^1_S
$$
over $S$ such that
\begin{enumerate}
\item $r|_E : E \to \mathbf{P}^1_\kappa$ is an isomorphism,
\item $\mathcal{O}_X(E) = \mathcal{O}_X(-1) =
r^*\mathcal{O}_{\mathbf{P}^1}(-1)$, and
\item $\mathcal{C}_{E/X} = (r|_E)^*\mathcal{O}_{\mathbf{P}^1}(1)$ and
$\mathcal{N}_{E/X} = (r|_E)^*\mathcal{O}_{\mathbf{P}^1}(-1)$.
\end{enumerate}
\end{lemma}

\begin{proof}
As $A$ is regular of dimension $2$ we can write $\mathfrak m = (x, y)$.
Then $x$ and $y$ placed in degree $1$ generate the Rees algebra
$\bigoplus_{n \geq 0} \mathfrak m^n$ over $A$. Recall that
$X = \text{Proj}(\bigoplus_{n \geq 0} \mathfrak m^n)$, see
Divisors, Lemma \ref{divisors-lemma-blowing-up-affine}.
Thus the surjection
$$
A[T_0, T_1] \longrightarrow \bigoplus\nolimits_{n \geq 0} \mathfrak m^n,
\quad
T_0 \mapsto x,\ T_1 \mapsto y
$$
of graded $A$-algebras induces a closed immersion
$r : X \to \mathbf{P}^1_S = \text{Proj}(A[T_0, T_1])$
such that $\mathcal{O}_X(1) = r^*\mathcal{O}_{\mathbf{P}^1_S}(1)$, see
Constructions, Lemma
\ref{constructions-lemma-surjective-graded-rings-generated-degree-1-map-proj}.
This proves (2) because $\mathcal{O}_X(E) = \mathcal{O}_X(-1)$
by Divisors, Lemma
\ref{divisors-lemma-blowing-up-gives-effective-Cartier-divisor}.

\medskip\noindent
To prove (1) note that
$$
\left(\bigoplus\nolimits_{n \geq 0} \mathfrak m^n\right) \otimes_A \kappa =
\bigoplus\nolimits_{n \geq 0} \mathfrak m^n/\mathfrak m^{n + 1} \cong
\kappa[\overline{x}, \overline{y}]
$$
a polynomial algebra, see Algebra, Lemma \ref{algebra-lemma-regular-graded}.
This proves that the fibre of $X \to S$ over $\Spec(\kappa)$ is equal to
$\text{Proj}(\kappa[\overline{x}, \overline{y}]) = \mathbf{P}^1_\kappa$, see
Constructions, Lemma \ref{constructions-lemma-base-change-map-proj}.
Recall that $E$ is the closed subscheme of $X$ defined by
$\mathfrak m\mathcal{O}_X$, i.e., $E = X_\kappa$.
By our choice of the morphism $r$ we see that $r|_E$ in fact
produces the identification of $E = X_\kappa$ with the special
fibre of $\mathbf{P}^1_S \to S$.

\medskip\noindent
Part (3) follows from (1) and (2) and Divisors, Lemma
\ref{divisors-lemma-conormal-effective-Cartier-divisor}.
\end{proof}

\begin{lemma}
\label{lemma-blowup-regular}
Let $(A, \mathfrak m, \kappa)$ be a regular local ring of dimension $2$.
Let $f : X \to S = \Spec(A)$ be the blowing up of $A$ in $\mathfrak m$.
Then $X$ is an irreducible regular scheme.
\end{lemma}

\begin{proof}
Observe that $X$ is integral by
Divisors, Lemma \ref{divisors-lemma-blow-up-integral-scheme}
and
Algebra, Lemma \ref{algebra-lemma-regular-domain}.
To see $X$ is regular it suffices to check that $\mathcal{O}_{X, x}$
is regular for closed points $x \in X$, see
Properties, Lemma \ref{properties-lemma-characterize-regular}.
Let $x \in X$ be a closed point. Since $f$ is proper $x$ maps to
$\mathfrak m$, i.e., $x$ is a point of the exceptional divisor $E$.
Then $E$ is an effective Cartier divisor and $E \cong \mathbf{P}^1_\kappa$.
Thus if $g \in \mathfrak m_x \subset \mathcal{O}_{X, x}$ is a local
equation for $E$, then
$\mathcal{O}_{X, x}/(g) \cong \mathcal{O}_{\mathbf{P}^1_\kappa, x}$.
Since $\mathbf{P}^1_\kappa$ is covered by two affine opens which are the
spectrum of a polynomial ring over $\kappa$, we see that
$\mathcal{O}_{\mathbf{P}^1_\kappa, x}$ is regular by
Algebra, Lemma \ref{algebra-lemma-dim-affine-space}.
We conclude by
Algebra, Lemma \ref{algebra-lemma-regular-mod-x}.
\end{proof}

\begin{lemma}
\label{lemma-blowup-pic}
Let $(A, \mathfrak m, \kappa)$ be a regular local ring of dimension $2$.
Let $f : X \to S = \Spec(A)$ be the blowing up of $A$ in $\mathfrak m$.
Then $\Pic(X) = \mathbf{Z}$ generated by $\mathcal{O}_X(E)$.
\end{lemma}

\begin{proof}
Recall that $E = \mathbf{P}^1_\kappa$ has Picard group $\mathbf{Z}$
with generator $\mathcal{O}(1)$, see
Divisors, Lemma \ref{divisors-lemma-Pic-projective-space-UFD}.
By Lemma \ref{lemma-blowup} the invertible $\mathcal{O}_X$-module
$\mathcal{O}_X(E)$ restricts to $\mathcal{O}(-1)$. Hence
$\mathcal{O}_X(E)$ generates an infinite cyclic group in $\Pic(X)$.
Since $A$ is regular it is a UFD, see More on Algebra, 
Lemma \ref{more-algebra-lemma-regular-local-UFD}.
Then the punctured spectrum $U = S \setminus \{\mathfrak m\} = X \setminus E$
has trivial Picard group, see
Divisors, Lemma \ref{divisors-lemma-open-subscheme-UFD}.
Hence for every invertible $\mathcal{O}_X$-module $\mathcal{L}$
there is an isomorphism $s : \mathcal{O}_U \to \mathcal{L}|_U$.
Then $s$ is a regular meromorphic section of $\mathcal{L}$
and we see that $\text{div}_\mathcal{L}(s) = nE$ for some
$n \in \mathbf{Z}$
(Divisors, Definition \ref{divisors-definition-divisor-invertible-sheaf}).
By Divisors, Lemma \ref{divisors-lemma-normal-c1-injective}
(and the fact that $X$ is normal by Lemma \ref{lemma-blowup-regular})
we conclude that $\mathcal{L} = \mathcal{O}_X(nE)$.
\end{proof}

\begin{lemma}
\label{lemma-cohomology-of-blowup}
Let $(A, \mathfrak m, \kappa)$ be a regular local ring of dimension $2$.
Let $f : X \to S = \Spec(A)$ be the blowing up of $A$ in $\mathfrak m$.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module.
\begin{enumerate}
\item $H^p(X, \mathcal{F}) = 0$ for $p \not \in \{0, 1\}$,
\item $H^1(X, \mathcal{O}_X(n)) = 0$ for $n \geq -1$,
\item $H^1(X, \mathcal{F}) = 0$ if $\mathcal{F}$ or $\mathcal{F}(1)$
is globally generated,
\item $H^0(X, \mathcal{O}_X(n)) = \mathfrak m^{\max(0, n)}$,
\item $\text{length}_A H^1(X, \mathcal{O}_X(n)) = -n(-n - 1)/2$
if $n < 0$.
\end{enumerate}
\end{lemma}

\begin{proof}
If $\mathfrak m = (x, y)$, then $X$ is covered by the spectra
of the affine blowup algebras $A[\frac{\mathfrak m}{x}]$ and
$A[\frac{\mathfrak m}{y}]$ because $x$ and $y$ placed in degree $1$
generate the Rees algebra $\bigoplus \mathfrak m^n$ over $A$.
See Divisors, Lemma \ref{divisors-lemma-blowing-up-affine} and
Constructions, Lemma \ref{constructions-lemma-proj-quasi-compact}.
Since $X$ is separated by
Constructions, Lemma \ref{constructions-lemma-proj-separated}
we see that cohomology of quasi-coherent sheaves vanishes in
degrees $\geq 2$ by Cohomology of Schemes, Lemma
\ref{coherent-lemma-vanishing-nr-affines}.

\medskip\noindent
Let $i : E \to X$ be the exceptional divisor, see
Divisors, Definition \ref{divisors-definition-blow-up}.
Recall that $\mathcal{O}_X(-E) = \mathcal{O}_X(1)$ is
$f$-relatively ample, see
Divisors, Lemma \ref{divisors-lemma-blowing-up-gives-effective-Cartier-divisor}.
Hence we know that $H^1(X, \mathcal{O}_X(-nE)) = 0$ for some $n > 0$,
see Cohomology of Schemes, Lemma \ref{coherent-lemma-kill-by-twisting}.
Consider the filtration
$$
\mathcal{O}_X(-nE) \subset \mathcal{O}_X(-(n - 1)E) \subset
\ldots \subset \mathcal{O}_X(-E) \subset \mathcal{O}_X \subset \mathcal{O}_X(E)
$$
The successive quotients are the sheaves
$$
\mathcal{O}_X(-t E)/\mathcal{O}_X(-(t + 1)E) =
\mathcal{O}_X(t)/\mathcal{I}(t) =
i_*\mathcal{O}_E(t)
$$
where $\mathcal{I} = \mathcal{O}_X(-E)$ is the ideal sheaf of $E$.
By Lemma \ref{lemma-blowup} we have $E = \mathbf{P}^1_\kappa$ and
$\mathcal{O}_E(1)$ indeed corresponds to the usual Serre twist of
the structure sheaf on $\mathbf{P}^1$. Hence the cohomology
of $\mathcal{O}_E(t)$ vanishes in degree $1$ for $t \geq -1$, see
Cohomology of Schemes, Lemma
\ref{coherent-lemma-cohomology-projective-space-over-ring}.
Since this is equal to $H^1(X, i_*\mathcal{O}_E(t))$ (by
Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology})
we find that $H^1(X, \mathcal{O}_X(-(t + 1)E)) \to H^1(X, \mathcal{O}_X(-tE))$
is surjective for $t \geq -1$. Hence
$$
0 = H^1(X, \mathcal{O}_X(-nE))
\longrightarrow
H^1(X, \mathcal{O}_X(-tE)) = H^1(X, \mathcal{O}_X(t))
$$
is surjective for $t \geq -1$ which proves (2).

\medskip\noindent
Let $\mathcal{F}$ be globally generated. This means there exists
a short exact sequence
$$
0 \to \mathcal{G} \to \bigoplus\nolimits_{i \in I} \mathcal{O}_X
\to \mathcal{F} \to 0
$$
Note that $H^1(X, \bigoplus_{i \in I} \mathcal{O}_X) =
\bigoplus_{i \in I} H^1(X, \mathcal{O}_X)$ by
Cohomology, Lemma \ref{cohomology-lemma-quasi-separated-cohomology-colimit}.
By part (2) we have $H^1(X, \mathcal{O}_X) = 0$.
If $\mathcal{F}(1)$ is globally generated, then we can find a
surjection $\bigoplus_{i \in I} \mathcal{O}_X(-1) \to \mathcal{F}$
and argue in a similar fashion.
In other words, part (3) follows from part (2).

\medskip\noindent
For part (4) we note that for all $n$ large enough we have
$\Gamma(X, \mathcal{O}_X(n)) = \mathfrak m^n$, see
Cohomology of Schemes, Lemma \ref{coherent-lemma-recover-tail-graded-module}.
If $n \geq 0$, then we can use the short exact sequence
$$
0 \to \mathcal{O}_X(n) \to \mathcal{O}_X(n - 1) \to
i_*\mathcal{O}_E(n - 1) \to 0
$$
and the vanishing of $H^1$ for the sheaf on the left to get a commutative
diagram
$$
\xymatrix{
0 \ar[r] &
\mathfrak m^{\max(0, n)} \ar[r] \ar[d] &
\mathfrak m^{\max(0, n - 1)} \ar[r] \ar[d] &
\mathfrak m^{\max(0, n)}/\mathfrak m^{\max(0, n - 1)} \ar[r] \ar[d] & 0\\
0 \ar[r] &
\Gamma(X, \mathcal{O}_X(n)) \ar[r] &
\Gamma(X, \mathcal{O}_X(n - 1)) \ar[r] &
\Gamma(E, \mathcal{O}_E(n - 1)) \ar[r] & 0
}
$$
with exact rows. In fact, the rows are exact also for $n < 0$
because in this case the groups on the right are zero.
In the proof of Lemma \ref{lemma-blowup}
we have seen that the right vertical arrow is an isomorphism
(details omitted). Hence if the left vertical arrow is an isomorphism, so
is the middle one. In this way we see that (4) holds by
descending induction on $n$.

\medskip\noindent
Finally, we prove (5) by descending induction on $n$ and the sequences
$$
0 \to \mathcal{O}_X(n) \to \mathcal{O}_X(n - 1) \to
i_*\mathcal{O}_E(n - 1) \to 0
$$
Namely, for $n \geq -1$ we already know $H^1(X, \mathcal{O}_X(n)) = 0$.
Since
$$
H^1(X, i_*\mathcal{O}_E(-2)) =
H^1(E, \mathcal{O}_E(-2)) =
H^1(\mathbf{P}^1_\kappa, \mathcal{O}(-2)) \cong \kappa
$$
by Cohomology of Schemes, Lemma
\ref{coherent-lemma-cohomology-projective-space-over-ring}
which has length $1$ as an $A$-module, we conclude from the long exact
cohomology sequence that (5) holds for $n = -2$. And so on and so forth.
\end{proof}

\begin{lemma}
\label{lemma-blowup-improve}
Let $(A, \mathfrak m)$ be a regular local ring of dimension $2$.
Let $f : X \to S = \Spec(A)$ be the blowing up of $A$ in $\mathfrak m$.
Let $\mathfrak m^n \subset I \subset \mathfrak m$ be an ideal.
Let $d \geq 0$ be the largest integer such that
$$
I \mathcal{O}_X \subset \mathcal{O}_X(-dE)
$$
where $E$ is the exceptional divisor. Set
$\mathcal{I}' = I\mathcal{O}_X(dE) \subset \mathcal{O}_X$.
Then $d > 0$, the sheaf
$\mathcal{O}_X/\mathcal{I}'$ is supported in finitely many
closed points $x_1, \ldots, x_r$ of $X$, and
\begin{align*}
\text{length}_A(A/I)
& >
\text{length}_A \Gamma(X, \mathcal{O}_X/\mathcal{I}') \\
& \geq
\sum\nolimits_{i = 1, \ldots, r}
\text{length}_{\mathcal{O}_{X, x_i}}
(\mathcal{O}_{X, x_i}/\mathcal{I}'_{x_i})
\end{align*}
\end{lemma}

\begin{proof}
Since $I \subset \mathfrak m$ we see that every element of $I$
vanishes on $E$. Thus we see that $d \geq 1$. On the other hand, since
$\mathfrak m^n \subset I$ we see that $d \leq n$. Consider the
short exact sequence
$$
0 \to I\mathcal{O}_X \to \mathcal{O}_X \to \mathcal{O}_X/I\mathcal{O}_X \to 0
$$
Since $I\mathcal{O}_X$ is globally generated, we see that
$H^1(X, I\mathcal{O}_X) = 0$ by Lemma \ref{lemma-cohomology-of-blowup}.
Hence we obtain a surjection
$A/I \to \Gamma(X, \mathcal{O}_X/I\mathcal{O}_X)$. Consider the short exact
sequence
$$
0 \to
\mathcal{O}_X(-dE)/I\mathcal{O}_X \to
\mathcal{O}_X/I\mathcal{O}_X \to
\mathcal{O}_X/\mathcal{O}_X(-dE) \to 0
$$
By Divisors, Lemma \ref{divisors-lemma-codim-1-part}
we see that $\mathcal{O}_X(-dE)/I\mathcal{O}_X$ is supported in finitely many
closed points of $X$. In particular, this coherent sheaf has vanishing higher
cohomology groups (detail omitted). Thus in the following diagram
$$
\xymatrix{
& & A/I \ar[d] \\
0 \ar[r] &
\Gamma(X, \mathcal{O}_X(-dE)/I\mathcal{O}_X) \ar[r] &
\Gamma(X, \mathcal{O}_X/I\mathcal{O}_X) \ar[r] &
\Gamma(X, \mathcal{O}_X/\mathcal{O}_X(-dE)) \ar[r] & 0
}
$$
the bottom row is exact and the vertical arrow surjective. We have
$$
\text{length}_A \Gamma(X, \mathcal{O}_X(-dE)/I\mathcal{O}_X) <
\text{length}_A(A/I)
$$
since $\Gamma(X, \mathcal{O}_X/\mathcal{O}_X(-dE))$ is nonzero.
Namely, the image of $1 \in \Gamma(X, \mathcal{O}_X)$
is nonzero as $d > 0$.

\medskip\noindent
To finish the proof we translate the results above into the statements
of the lemma. Since
$\mathcal{O}_X(dE)$ is invertible we have
$$
\mathcal{O}_X/\mathcal{I}' =
\mathcal{O}_X(-dE)/I\mathcal{O}_X \otimes_{\mathcal{O}_X} \mathcal{O}_X(dE).
$$
Thus $\mathcal{O}_X/\mathcal{I}'$ and $\mathcal{O}_X(-dE)/I\mathcal{O}_X$
are supported in the same set of finitely many
closed points, say $x_1, \ldots, x_r \in E \subset X$.
Moreover we obtain
$$
\Gamma(X, \mathcal{O}_X(-dE)/I\mathcal{O}_X) =
\bigoplus \mathcal{O}_X(-dE)_{x_i}/I\mathcal{O}_{X, x_i}
\cong
\bigoplus \mathcal{O}_{X, x_i}/\mathcal{I}'_{x_i} =
\Gamma(X, \mathcal{O}_X/\mathcal{I}')
$$
because an invertible module over a local ring is trivial.
Thus we obtain the strict inequality. We also get the second because
$$
\text{length}_A(\mathcal{O}_{X, x_i}/\mathcal{I}'_{x_i}) \geq
\text{length}_{\mathcal{O}_{X, x_i}}(\mathcal{O}_{X, x_i}/\mathcal{I}'_{x_i})
$$
as is immediate from the definition of length.
\end{proof}

\begin{lemma}
\label{lemma-differentials-of-blowup}
Let $(A, \mathfrak m, \kappa)$ be a regular local ring of dimension $2$.
Let $f : X \to S = \Spec(A)$ be the blowing up of $A$ in $\mathfrak m$.
Then $\Omega_{X/S} = i_*\Omega_{E/\kappa}$, where $i : E \to X$
is the immersion of the exceptional divisor.
\end{lemma}

\begin{proof}
Writing $\mathbf{P}^1 = \mathbf{P}^1_S$, let
$r : X \to \mathbf{P}^1$ be as in Lemma \ref{lemma-blowup}.
Then we have an exact sequence
$$
\mathcal{C}_{X/\mathbf{P}^1} \to r^*\Omega_{\mathbf{P}^1/S} \to
\Omega_{X/S} \to 0
$$
see Morphisms, Lemma \ref{morphisms-lemma-differentials-relative-immersion}.
Since $\Omega_{\mathbf{P}^1/S}|_E = \Omega_{E/\kappa}$ by
Morphisms, Lemma \ref{morphisms-lemma-base-change-differentials}
it suffices to see that the first arrow defines a surjection
onto the kernel of the canonical map
$r^*\Omega_{\mathbf{P}^1/S} \to i_*\Omega_{E/\kappa}$.
This we can do locally. With notation as in the proof of
Lemma \ref{lemma-blowup} on an affine open of $X$ the morphism $f$
corresponds to the ring map
$$
A \to A[t]/(xt - y)
$$
where $x, y \in \mathfrak m$ are generators. Thus
$\text{d}(xt - y) = x\text{d}t$ and $y\text{d}t = t \cdot x \text{d}t$
which proves what we want.
\end{proof}



\section{Dominating by quadratic transformations}
\label{section-dominating-by-quadratic}

\noindent
Using the result above we can prove that blowups in points dominate
any modification of a regular $2$ dimensional scheme.

\medskip\noindent
Let $X$ be a scheme. Let $x \in X$ be a closed point. As usual, we view
$i : x = \Spec(\kappa(x)) \to X$ as a closed subscheme.
The {\it blowing up $X' \to X$ of $X$ at $x$} is the blowing up of $X$
in the closed subscheme $x \subset X$. Observe that if $X$ is locally
Noetherian, then $X' \to X$ is projective (in particular proper) by
Divisors, Lemma \ref{divisors-lemma-blowing-up-projective}.

\begin{lemma}
\label{lemma-make-ideal-principal}
Let $X$ be a Noetherian scheme. Let $T \subset X$ be a finite set of
closed points $x$ such that $\mathcal{O}_{X, x}$ is
regular of dimension $2$ for $x \in T$.
Let $\mathcal{I} \subset \mathcal{O}_X$ be a quasi-coherent
sheaf of ideals such that $\mathcal{O}_X/\mathcal{I}$ is supported
on $T$.
Then there exists a sequence
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to X_0 = X
$$
where $X_{i + 1} \to X_i$ is the blowing up of $X_i$ at a closed
point $x_i$ lying above a point of $T$ such that
$\mathcal{I}\mathcal{O}_{X_n}$ is an invertible ideal sheaf.
\end{lemma}

\begin{proof}
Say $T = \{x_1, \ldots, x_r\}$. Set
$$
n_i = \text{length}_{\mathcal{O}_{X, x_i}}(\mathcal{O}_{X, x_i}/I_i)
$$
This is finite as $\mathcal{O}_X/\mathcal{I}$ is supported on $T$
and hence $\mathcal{O}_{X, x_i}/I_i$ has support equal to
$\{\mathfrak m_{x_i}\}$ (see Algebra, Lemma \ref{algebra-lemma-support-point}).
We are going to use induction on $\sum n_i$. If $n_i = 0$ for all
$i$, then $\mathcal{I} = \mathcal{O}_X$ and we are done.

\medskip\noindent
Suppose $n_i > 0$. Let $X' \to X$ be the blowing up of $X$ in $x_i$
(see discussion above the lemma).
Since $\Spec(\mathcal{O}_{X, x_i}) \to X$ is flat we see that
$X' \times_X \Spec(\mathcal{O}_{X, x_i})$ is the blowup of
the ring $\mathcal{O}_{X, x_i}$ in the maximal ideal, see
Divisors, Lemma
\ref{divisors-lemma-flat-base-change-blowing-up}.
Hence the square in the commutative diagram
$$
\xymatrix{
\text{Proj}(\bigoplus\nolimits_{d \geq 0} \mathfrak m_{x_i}^d) \ar[r] \ar[d] &
X' \ar[d] \\
\Spec(\mathcal{O}_{X, x_i}) \ar[r] & X
}
$$
is cartesian. Let $E \subset X'$ and
$E' \subset \text{Proj}(\bigoplus\nolimits_{d \geq 0} \mathfrak m_{x_i}^d)$
be the exceptional divisors. Let $d \geq 1$ be the integer found in
Lemma \ref{lemma-blowup-improve} for the ideal
$\mathcal{I}_i \subset \mathcal{O}_{X, x_i}$.
Since the horizontal arrows in the diagram are flat, since
$E' \to E$ is surjective, and since $E'$ is the pullback of $E$, we see that
$$
\mathcal{I}\mathcal{O}_{X'} \subset \mathcal{O}_{X'}(-dE)
$$
(some details omitted).
Set $\mathcal{I}' = \mathcal{I}\mathcal{O}_{X'}(dE) \subset \mathcal{O}_{X'}$.
Then we see that $\mathcal{O}_{X'}/\mathcal{I}'$ is supported in finitely
many closed points $T' \subset |X'|$ because this holds over
$X \setminus \{x_i\}$ and for the pullback to
$\text{Proj}(\bigoplus\nolimits_{d \geq 0} \mathfrak m_{x_i}^d)$.
The final assertion of Lemma \ref{lemma-blowup-improve}
tells us that the sum of the lengths of the stalks
$\mathcal{O}_{X', x'}/\mathcal{I}'\mathcal{O}_{X', x'}$
for $x'$ lying over $x_i$ is $< n_i$. Hence the sum of the lengths
has decreased.

\medskip\noindent
By induction hypothesis, there exists a sequence
$$
X'_n \to \ldots \to X'_1 \to X'
$$
of blowups at closed points lying over $T'$ such that
$\mathcal{I}'\mathcal{O}_{X'_n}$ is invertible. Since
$\mathcal{I}'\mathcal{O}_{X'}(-dE) = \mathcal{I}\mathcal{O}_{X'}$, we see
that $\mathcal{I}\mathcal{O}_{X'_n} =
\mathcal{I}'\mathcal{O}_{X'_n}(-d(f')^{-1}E)$
where $f' : X'_n \to X'$ is the composition.
Note that $(f')^{-1}E$ is an effective Cartier divisor by
Divisors, Lemma \ref{divisors-lemma-blow-up-pullback-effective-Cartier}.
Thus we are done by
Divisors, Lemma \ref{divisors-lemma-sum-effective-Cartier-divisors}.
\end{proof}

\begin{lemma}
\label{lemma-dominate-by-blowing-up-in-points}
Let $X$ be a Noetherian scheme. Let $T \subset X$ be a finite set of
closed points $x$ such that $\mathcal{O}_{X, x}$ is a regular local
ring of dimension $2$. Let $f : Y \to X$ be a proper morphism of
schemes which is an isomorphism over $U = X \setminus T$.
Then there exists a sequence
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to X_0 = X
$$
where $X_{i + 1} \to X_i$ is the blowing up of $X_i$ at a closed
point $x_i$ lying above a point of $T$ and a factorization $X_n \to Y \to X$
of the composition.
\end{lemma}

\begin{proof}
By More on Flatness, Lemma \ref{flat-lemma-dominate-modification-by-blowup} 
there exists a $U$-admissible blowup $X' \to X$ which dominates
$Y \to X$. Hence we may assume there exists an ideal sheaf
$\mathcal{I} \subset \mathcal{O}_X$ such that
$\mathcal{O}_X/\mathcal{I}$ is supported on $T$ and such that
$Y$ is the blowing up of $X$ in $\mathcal{I}$.
By Lemma \ref{lemma-make-ideal-principal} 
there exists a sequence
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to X_0 = X
$$
where $X_{i + 1} \to X_i$ is the blowing up of $X_i$ at a closed
point $x_i$ lying above a point of $T$ such that
$\mathcal{I}\mathcal{O}_{X_n}$ is an invertible ideal sheaf.
By the universal property of blowing up
(Divisors, Lemma
\ref{divisors-lemma-universal-property-blowing-up})
we find the desired factorization.
\end{proof}

\begin{lemma}
\label{lemma-extend-rational-map-blowing-up}
Let $S$ be a scheme. Let $X$ be a scheme over $S$ which is
regular and has dimension $2$. Let $Y$ be a proper
scheme over $S$. Given an $S$-rational map $f : U \to Y$ from
$X$ to $Y$ there exists a sequence
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to X_0 = X
$$
and an $S$-morphism $f_n : X_n \to Y$ such that $X_{i + 1} \to X_i$
blowing up of $X_i$ at a closed point not lying over $U$
and $f_n$ and $f$ agree.
\end{lemma}

\begin{proof}
We may assume $U$ contains every point of codimension $1$, see
Morphisms, Lemma \ref{morphisms-lemma-extend-across}.
Hence the complement $T \subset X$ of $U$ is a finite set
of closed points whose local rings are regular of dimension $2$.
Applying
Divisors, Lemma \ref{divisors-lemma-extend-rational-map-after-modification}
we find a proper morphism $p : X' \to X$ which is an isomorphism
over $U$ and a morphism $f' : X' \to Y$ agreeing with $f$ over $U$.
Apply Lemma \ref{lemma-dominate-by-blowing-up-in-points}
to the morphism $p : X' \to X$. The composition $X_n \to X' \to Y$ is
the desired morphism.
\end{proof}






\section{Dominating by normalized blowups}
\label{section-normalized-blowups}

\noindent
In this section we prove that a modification of a surface can be dominated
by a sequence of normalized blowups in points.

\begin{definition}
\label{definition-normalized-blowup}
Let $X$ be a scheme such that every quasi-compact open has finitely
many irreducible components. Let $x \in X$ be a closed point.
The {\it normalized blowup of $X$ at $x$} is the composition
$X'' \to X' \to X$ where $X' \to X$ is the blowup
of $X$ in $x$ and $X'' \to X'$ is the normalization of $X'$.
\end{definition}

\noindent
Here the normalization $X'' \to X'$ is defined as the scheme $X'$
has an open covering by opens which have finitely many irreducible
components by
Divisors, Lemma \ref{divisors-lemma-blow-up-and-irreducible-components}.
See Morphisms, Definition \ref{morphisms-definition-normalization}
for the definition of the normalization.

\medskip\noindent
In general the normalized blowing up need not be proper even
when $X$ is Noetherian. Recall that a scheme is Nagata if it
has an open covering by affines which are spectra of Nagata rings
(Properties, Definition \ref{properties-definition-nagata}).

\begin{lemma}
\label{lemma-Nagata-normalized-blowup}
In Definition \ref{definition-normalized-blowup} if $X$ is Nagata,
then the normalized blowing up of $X$ at $x$ is
normal, Nagata, and proper over $X$.
\end{lemma}

\begin{proof}
The blowup morphism $X' \to X$ is proper
(as $X$ is locally Noetherian we may apply
Divisors, Lemma \ref{divisors-lemma-blowing-up-projective}).
Thus $X'$ is Nagata
(Morphisms, Lemma \ref{morphisms-lemma-finite-type-nagata}).
Therefore the normalization $X'' \to X'$ is finite
(Morphisms, Lemma \ref{morphisms-lemma-nagata-normalization})
and we conclude that $X'' \to X$ is proper as well
(Morphisms, Lemmas \ref{morphisms-lemma-finite-proper} and
\ref{morphisms-lemma-composition-proper}).
It follows that the normalized blowing up
is a normal (Morphisms, Lemma
\ref{morphisms-lemma-normalization-normal})
Nagata algebraic space.
\end{proof}

\noindent
In the following lemma we need to assume $X$ is Noetherian in order
to make sure that it has finitely many irreducible components.
Then the properness of $f : Y \to X$ assures that $Y$ has finitely
many irreducible components too and it makes sense to require
$f$ to be birational
(Morphisms, Definition \ref{morphisms-definition-birational}).

\begin{lemma}
\label{lemma-dominate-by-normalized-blowing-up}
Let $X$ be a scheme which is Noetherian, Nagata, and has dimension $2$.
Let $f : Y \to X$ be a proper birational morphism.
Then there exists a commutative diagram
$$
\xymatrix{
X_n \ar[r] \ar[d] &
X_{n - 1} \ar[r] &
\ldots \ar[r] &
X_1 \ar[r] &
X_0 \ar[d] \\
Y \ar[rrrr]  & & & & X
}
$$
where $X_0 \to X$ is the normalization and
where $X_{i + 1} \to X_i$ is the normalized blowing up of $X_i$ at a closed
point.
\end{lemma}

\begin{proof}
We will use the results of Morphisms, Sections
\ref{morphisms-section-nagata},
\ref{morphisms-section-dimension-formula}, and
\ref{morphisms-section-normalization} without further mention.
We may replace $Y$ by its normalization. Let $X_0 \to X$
be the normalization. The morphism $Y \to X$ factors through $X_0$.
Thus we may assume that both $X$ and $Y$ are normal.

\medskip\noindent
Assume $X$ and $Y$ are normal. The morphism $f : Y \to X$ is an isomorphism
over an open which contains every point of codimension $0$ and $1$ in $Y$ and
every point of $Y$ over which the fibre is finite, see Varieties, Lemma
\ref{varieties-lemma-modification-normal-iso-over-codimension-1}.
Hence there is a finite set of closed points $T \subset X$
such that $f$ is an isomorphism over $X \setminus T$. For each $x \in T$
the fibre $Y_x$ is a proper geometrically connected scheme of dimension $1$
over $\kappa(x)$, see
More on Morphisms, Lemma
\ref{more-morphisms-lemma-geometrically-connected-fibres-towards-normal}.
Thus
$$
BadCurves(f) = \{C \subset Y\text{ closed} \mid
\dim(C) = 1, f(C) = \text{a point}\}
$$
is a finite set. We will prove the lemma by induction on the number
of elements of $BadCurves(f)$. The base case is the case where $BadCurves(f)$
is empty, and in that case $f$ is an isomorphism.

\medskip\noindent
Fix $x \in T$. Let $X' \to X$ be the normalized blowup of $X$ at $x$ and let
$Y'$ be the normalization of $Y \times_X X'$. Picture
$$
\xymatrix{
Y' \ar[r]_{f'} \ar[d] & X' \ar[d] \\
Y \ar[r]^f & X
}
$$
Let $x' \in X'$ be a closed point lying over $x$ such that
the fibre $Y'_{x'}$ has dimension $\geq 1$. Let $C' \subset Y'$
be an irreducible component of $Y'_{x'}$, i.e., $C' \in BadCurves(f')$.
Since $Y' \to Y \times_X X'$ is finite we see that $C'$ must map
to an irreducible component $C \subset Y_x$.
If is clear that $C \in BadCurves(f)$.
Since $Y' \to Y$ is birational and hence an isomorphism over points of
codimension $1$ in $Y$, we see that we obtain an injective map
$$
BadCurves(f') \longrightarrow BadCurves(f)
$$
Thus it suffices to show that after a finite number of these
normalized blowups we get rid at of at least one of the bad
curves, i.e., the displayed map is not surjective.

\medskip\noindent
We will get rid of a bad curve using an argument due to Zariski.
Pick $C \in BadCurves(f)$ lying over our $x$. Denote $\mathcal{O}_{Y, C}$
the local ring of $Y$ at the generic point of $C$. Choose an element
$u \in \mathcal{O}_{X, C}$ whose image in the residue field
$R(C)$ is transcendental over $\kappa(x)$ (we can do this because
$R(C)$ has transcendence degree $1$ over $\kappa(x)$ by
Varieties, Lemma \ref{varieties-lemma-dimension-locally-algebraic}).
We can write $u = a/b$ with $a, b \in \mathcal{O}_{X, x}$ as
$\mathcal{O}_{Y, C}$ and $\mathcal{O}_{X, x}$ have the same
fraction fields. By our choice of $u$ it must be the case that
$a, b \in \mathfrak m_x$. Hence
$$
N_{u, a, b} = \min
\{\text{ord}_{\mathcal{O}_{Y, C}}(a), \text{ord}_{\mathcal{O}_{Y, C}}(b)\} > 0
$$
Thus we can do descending induction on this integer.
Let $X' \to X$ be the normalized blowing up of $x$
and let $Y'$ be the normalization of $X' \times_X Y$ as above. We will
show that if $C$ is the image of some bad curve $C' \subset Y'$
lying over $x' \in X'$, then
there exists a choice of $a', b' \mathcal{O}_{X', x'}$
such that $N_{u, a', b'} < N_{u, a, b}$. This will finish the proof.
Namely, since $X' \to X$ factors through the blowing up, we see that
there exists a nonzero element $d \in \mathfrak m_{x'}$ such that
$a = a' d$ and $b = b' d$ (namely, take $d$ to be the local equation
for the exceptional divisor of the blowup). Since $Y' \to Y$
is an isomorphism over an open containing the generic point of $C$
(seen above) we see that $\mathcal{O}_{Y', C'} = \mathcal{O}_{Y, C}$.
Hence
$$
\text{ord}_{\mathcal{O}_{Y, C}}(a) =
\text{ord}_{\mathcal{O}_{Y', C'}}(a' d) =
\text{ord}_{\mathcal{O}_{Y', C'}}(a') +
\text{ord}_{\mathcal{O}_{Y', C'}}(d) >
\text{ord}_{\mathcal{O}_{Y', C'}}(a')
$$
Similarly for $b$ and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-extend-rational-map-normalized-blowing-up}
Let $S$ be a scheme. Let $X$ be a scheme over $S$ which is
Noetherian, Nagata, and has dimension $2$. Let $Y$ be a proper
scheme over $S$. Given an $S$-rational map $f : U \to Y$ from
$X$ to $Y$ there exists a sequence
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to X_0 \to X
$$
and an $S$-morphism $f_n : X_n \to Y$ such that $X_0 \to X$ is the
normalization, $X_{i + 1} \to X_i$ is the normalized blowing up of
$X_i$ at a closed point, and $f_n$ and $f$ agree.
\end{lemma}

\begin{proof}
Applying
Divisors, Lemma \ref{divisors-lemma-extend-rational-map-after-modification}
we find a proper morphism $p : X' \to X$ which is an isomorphism
over $U$ and a morphism $f' : X' \to Y$ agreeing with $f$ over $U$.
Apply Lemma \ref{lemma-dominate-by-normalized-blowing-up}
to the morphism $p : X' \to X$. The composition $X_n \to X' \to Y$ is
the desired morphism.
\end{proof}





\section{Modifying over local rings}
\label{section-modifications}

\noindent
Let $S$ be a scheme. Let $s_1, \ldots, s_n \in S$ be pairwise distinct
closed points. Assume that the open embedding
$$
U = S \setminus \{s_1, \ldots, s_n\} \longrightarrow S
$$
is quasi-compact. Denote $FP_{S, \{s_1, \ldots, s_n\}}$
the category of morphisms $f : X \to S$ of finite presentation
which induce an isomorphism $f^{-1}(U) \to U$.
Morphisms are morphisms of schemes over $S$.
For each $i$ set $S_i = \Spec(\mathcal{O}_{S, s_i})$
and let $V_i = S_i \setminus \{s_i\}$. Denote
$FP_{S_i, s_i}$ the category of
morphisms $g_i : Y_i \to S_i$ of finite presentation which induce an
isomorphism $g_i^{-1}(V_i) \to V_i$.
Morphisms are morphisms over $S_i$.
Base change defines an functor
\begin{equation}
\label{equation-equivalence}
F :
FP_{S, \{s_1, \ldots, s_n\}}
\longrightarrow
FP_{S_1, s_1} \times \ldots \times FP_{S_n, s_n}
\end{equation}
To reduce at least some of the problems in this chapter to the case
of local rings we have the following lemma.

\begin{lemma}
\label{lemma-equivalence}
The functor $F$ (\ref{equation-equivalence}) is an equivalence.
\end{lemma}

\begin{proof}
For $n = 1$ this is Limits, Lemma \ref{limits-lemma-modifications}.
For $n > 1$ the lemma can be proved in exactly the same way or it
can be deduced from it. For example, suppose that
$g_i : Y_i \to S_i$ are objects of $FP_{S_i, s_i}$.
Then by the case $n = 1$ we can find $f'_i : X'_i \to S$
of finite presentation
which are isomorphisms over $S \setminus \{s_i\}$ and whose
base change to $S_i$ is $g_i$. Then we can set
$$
f : X = X'_1 \times_S \ldots \times_S X'_n \to S
$$
This is an object of $FP_{S, \{s_1, \ldots, s_n\}}$
whose base change by $S_i \to S$ recovers $g_i$. Thus the functor
is essentially surjective. We omit the proof of
fully faithfulness.
\end{proof}

\begin{lemma}
\label{lemma-equivalence-properties}
Let $S, s_i, S_i$ be as in (\ref{equation-equivalence}).
If $f : X \to S$ corresponds to $g_i : Y_i \to S_i$ under $F$,
then $f$ is separated, proper, finite, if and only if $g_i$ is so
for $i = 1, \ldots, n$.
\end{lemma}

\begin{proof}
Follows from Limits, Lemma
\ref{limits-lemma-modifications-properties}.
\end{proof}

\begin{lemma}
\label{lemma-equivalence-fibre}
Let $S, s_i, S_i$ be as in (\ref{equation-equivalence}).
If $f : X \to S$ corresponds to $g_i : Y_i \to S_i$ under $F$,
then $X_{s_i} \cong (Y_i)_{s_i}$ as schemes over $\kappa(s_i)$.
\end{lemma}

\begin{proof}
This is clear.
\end{proof}

\begin{lemma}
\label{lemma-equivalence-sequence-blowups}
Let $S, s_i, S_i$ be as in (\ref{equation-equivalence})
and assume $f : X \to S$ corresponds to $g_i : Y_i \to S_i$ under $F$.
Then there exists a factorization
$$
X = Z_m \to Z_{m - 1} \to \ldots \to Z_1 \to Z_0 = S
$$
of $f$ where $Z_{j + 1} \to Z_j$ is the blowing up of $Z_j$ at a closed
point $z_j$ lying over $\{s_1, \ldots, s_n\}$ if and only if for each
$i$ there exists a factorization
$$
Y_i = Z_{i, m_i} \to Z_{i, m_i - 1} \to \ldots \to Z_{i, 1} \to Z_{i, 0} = S_i
$$
of $g_i$ where $Z_{i, j + 1} \to Z_{i, j}$ is the blowing up of $Z_{i, j}$
at a closed point $z_{i, j}$ lying over $s_i$.
\end{lemma}

\begin{proof}
Let's start with a sequence of blowups
$Z_m \to Z_{m - 1} \to \ldots \to Z_1 \to Z_0 = S$.
The first morphism $Z_1 \to S$ is given
by blowing up one of the $s_i$, say $s_1$. Applying $F$
to $Z_1 \to S$ we find a blowup $Z_{1, 1} \to S_1$ at $s_1$
is the blowing up at $s_1$ and otherwise $Z_{i, 0} = S_i$ for $i > 1$.
In the next step, we either blow up one of the $s_i$, $i \geq 2$
on $Z_1$ or we pick a closed point $z_1$ of the fibre of $Z_1 \to S$
over $s_1$. In the first case it is clear what to do and in
the second case we use that $(Z_1)_{s_1} \cong (Z_{1, 1})_{s_1}$
(Lemma \ref{lemma-equivalence-fibre})
to get a closed point $z_{1, 1} \in Z_{1, 1}$ corresponding to $z_1$.
Then we set $Z_{1, 2} \to Z_{1, 1}$ equal to the blowing up
in $z_{1, 1}$. Continuing in this manner we construct the factorizations
of each $g_i$.

\medskip\noindent
Conversely, given sequences of blowups
$Z_{i, m_i} \to Z_{i, m_i - 1} \to \ldots \to Z_{i, 1} \to Z_{i, 0} = S_i$
we construct the sequence of blowing ups of $S$ in exactly the same manner.
\end{proof}

\noindent
Here is the analogue of
Lemma \ref{lemma-equivalence-sequence-blowups}
for normalized blowups.

\begin{lemma}
\label{lemma-equivalence-sequence-normalized-blowups}
Let $S, s_i, S_i$ be as in (\ref{equation-equivalence})
and assume $f : X \to S$ corresponds to $g_i : Y_i \to S_i$ under $F$.
Assume every quasi-compact open of $S$ has finitely many irreducible
components.  Then there exists a factorization
$$
X = Z_m \to Z_{m - 1} \to \ldots \to Z_1 \to Z_0 = S
$$
of $f$ where $Z_{j + 1} \to Z_j$ is the normalized blowing up of $Z_j$
at a closed point $z_j$ lying over $\{x_1, \ldots, x_n\}$ if and only if
for each $i$ there exists a factorization
$$
Y_i = Z_{i, m_i} \to Z_{i, m_i - 1} \to \ldots \to Z_{i, 1} \to Z_{i, 0} = S_i
$$
of $g_i$ where $Z_{i, j + 1} \to Z_{i, j}$ is the normalized blowing up of
$Z_{i, j}$ at a closed point $z_{i, j}$ lying over $s_i$.
\end{lemma}

\begin{proof}
The assumption on $S$ is used to assure us (successively) that
the schemes we are normalizing have locally finitely many irreducible
components so that the statement makes sense. Having said this the
lemma follows by the exact same argument as used to prove
Lemma \ref{lemma-equivalence-sequence-blowups}.
\end{proof}








\section{Vanishing}
\label{section-vanishing}

\noindent
In this section we will often work in the following setting.
Recall that a modification is a proper birational morphism
between integral schemes (Morphisms, Definition
\ref{morphisms-definition-modification}).

\begin{situation}
\label{situation-vanishing}
Here $(A, \mathfrak m, \kappa)$ be a local Noetherian normal domain of
dimension $2$. Let $s$ be the closed point of $S = \Spec(A)$ and
$U = S \setminus \{s\}$. Let $f : X \to S$ be a modification.
We denote $C_1, \ldots, C_r$ the irreducible
components of the special fibre $X_s$ of $f$.
\end{situation}

\noindent
By Varieties, Lemma
\ref{varieties-lemma-modification-normal-iso-over-codimension-1}
the morphism $f$ defines an isomorphism $f^{-1}(U) \to U$.
The special fibre $X_s$ is proper over $\Spec(\kappa)$ and
has dimension at most $1$ by Varieties, Lemma
\ref{varieties-lemma-dimension-fibre-in-higher-codimension}.
By Stein factorization (More on Morphisms, Lemma
\ref{more-morphisms-lemma-geometrically-connected-fibres-towards-normal})
we have $f_*\mathcal{O}_X = \mathcal{O}_S$ and
the special fibre $X_s$ is geometrically connected over $\kappa$.
If $X_s$ has dimension $0$, then $f$ is finite
(More on Morphisms, Lemma
\ref{more-morphisms-lemma-proper-finite-fibre-finite-in-neighbourhood})
and hence an isomorphism
(Morphisms, Lemma \ref{morphisms-lemma-finite-birational-over-normal}).
We will discard this uninteresting case and we conclude that
$\dim(C_i) = 1$ for $i = 1, \ldots, r$.

\begin{lemma}
\label{lemma-dominate-by-scheme-modification}
In Situation \ref{situation-vanishing} there exists a $U$-admissible
blowup $X' \to S$ which dominates $X$.
\end{lemma}

\begin{proof}
This is a special case of
More on Flatness, Lemma \ref{flat-lemma-dominate-modification-by-blowup}.
\end{proof}

\begin{lemma}
\label{lemma-nice-meromorphic-function}
In Situation \ref{situation-vanishing} there exists a nonzero
$f \in \mathfrak m$ such that for every $i = 1, \ldots, r$ there exist
\begin{enumerate}
\item a closed point $x_i \in C_i$ with $x_i \not \in C_j$ for $j \not = i$,
\item a factorization $f = g_i f_i$ of $f$ in $\mathcal{O}_{X, x_i}$
such that $g_i \in \mathfrak m_{x_i}$ maps to a nonzero element
of $\mathcal{O}_{C_i, x_i}$.
\end{enumerate}
\end{lemma}

\begin{proof}
We will use the observations made following Situation \ref{situation-vanishing}
without further mention. Pick a closed point $x_i \in C_i$ which is not in
$C_j$ for $j \not = i$. Pick $g_i \in \mathfrak m_{x_i}$ which maps to a
nonzero element of $\mathcal{O}_{C_i, x_i}$. Since the fraction field of $A$
is the fraction field of $\mathcal{O}_{X_i, x_i}$ we can write
$g_i = a_i/b_i$ for some $a_i, b_i \in A$. Take $f = \prod a_i$.
\end{proof}

\begin{lemma}
\label{lemma-nontrivial-normal-bundle}
In Situation \ref{situation-vanishing} assume $X$ is normal.
Let $Z \subset X$ be a nonempty effective Cartier divisor such that
$Z \subset X_s$ set theoretically.
Then the conormal sheaf of $Z$ is not trivial.
More precisely, there exists an $i$ such that $C_i \subset Z$
and $\deg(\mathcal{C}_{Z/X}|_{C_i}) > 0$.
\end{lemma}

\begin{proof}
We will use the observations made following Situation \ref{situation-vanishing}
without further mention. Let $f$ be a function as in
Lemma \ref{lemma-nice-meromorphic-function}.
Let $\xi_i \in C_i$ be the generic point. Let
$\mathcal{O}_i$ be the local ring of $X$ at $\xi_i$. Then $\mathcal{O}_i$
is a discrete valuation ring. Let $e_i$ be the valuation of
$f$ in $\mathcal{O}_i$, so $e_i > 0$. Let $h_i \in \mathcal{O}_i$ be a local
equation for $Z$ and let $d_i$ be its valuation. Then $d_i \geq 0$.
Choose and fix $i$ with $d_i/e_i$ maximal (then $d_i > 0$ as
$Z$ is not empty). Replace $f$ by $f^{d_i}$ and $Z$ by $e_iZ$.
This is permissible, by the relation
$\mathcal{O}_X(e_i Z) = \mathcal{O}_X(Z)^{\otimes e_i}$,
the relation between the conormal sheaf and $\mathcal{O}_X(Z)$
(see Divisors, Lemmas
\ref{divisors-lemma-invertible-sheaf-sum-effective-Cartier-divisors}
and \ref{divisors-lemma-conormal-effective-Cartier-divisor}, and
since the degree gets multiplied by $e_i$, see
Varieties, Lemma \ref{varieties-lemma-degree-tensor-product}.
Let $\mathcal{I}$ be the ideal sheaf of $Z$ so that
$\mathcal{C}_{Z/X} = \mathcal{I}|_Z$. Consider the image $\overline{f}$
of $f$ in $\Gamma(Z, \mathcal{O}_Z)$. By our choices above we see
that $\overline{f}$ vanishes in the generic points of irreducible
components of $Z$ (these are all generic points of $C_j$ as $Z$ is
contained in the special fibre). On the other hand, $Z$ is $(S_1)$ by
Divisors, Lemma \ref{divisors-lemma-normal-effective-Cartier-divisor-S1}.
Thus the scheme $Z$ has no embedded associated points and
we conclude that $\overline{f} = 0$ (Divisors, Lemmas
\ref{divisors-lemma-S1-no-embedded} and
\ref{divisors-lemma-restriction-injective-open-contains-weakly-ass}).
Hence $f$ is a global section of $\mathcal{I}$
which generates $\mathcal{I}_{\xi_i}$ by construction.
Thus the image $s_i$ of $f$ in $\Gamma(C_i, \mathcal{I}|_{C_i})$ is nonzero.
However, our choice of $f$ guarantees that $s_i$ has a zero at $x_i$.
Hence the degree of $\mathcal{I}|_{C_i}$ is $> 0$ by
Varieties, Lemma \ref{varieties-lemma-check-invertible-sheaf-trivial}.
\end{proof}

\begin{lemma}
\label{lemma-H1-injective}
In Situation \ref{situation-vanishing} assume $X$ is normal
and $A$ Nagata. The map
$$
H^1(X, \mathcal{O}_X) \longrightarrow H^1(f^{-1}(U), \mathcal{O}_X)
$$
is injective.
\end{lemma}

\begin{proof}
Let $0 \to \mathcal{O}_X \to \mathcal{E} \to \mathcal{O}_X \to 0$ be the
extension corresponding to a nontrivial element $\xi$ of
$H^1(X, \mathcal{O}_X)$
(Cohomology, Lemma \ref{cohomology-lemma-h1-extensions}).
Let $\pi : P = \mathbf{P}(\mathcal{E}) \to X$
be the projective bundle associated to $\mathcal{E}$.
The surjection $\mathcal{E} \to \mathcal{O}_X$
defines a section $\sigma : X \to P$ whose conormal sheaf is
isomorphic to $\mathcal{O}_X$ (Divisors, Lemma
\ref{divisors-lemma-conormal-sheaf-section-projective-bundle}).
If the restriction of $\xi$ to $f^{-1}(U)$ is trivial, then we get
a map $\mathcal{E}|_{f^{-1}(U)} \to \mathcal{O}_{f^{-1}(U)}$ splitting
the injection $\mathcal{O}_X \to \mathcal{E}$. This defines a second
section $\sigma' : f^{-1}(U) \to P$ disjoint from $\sigma$. Since $\xi$
is nontrivial we conclude that $\sigma'$ cannot extend to all of $X$
and be disjoint from $\sigma$. Let $X' \subset P$ be the
scheme theoretic image of $\sigma'$ (Morphisms,
Definition \ref{morphisms-definition-scheme-theoretic-image}).
Picture
$$
\xymatrix{
& X' \ar[rd]_g \ar[r] & P \ar[d]_\pi \\
f^{-1}(U) \ar[ru]_{\sigma'} \ar[rr] & & X \ar@/_/[u]_\sigma
}
$$
The morphism $P \setminus \sigma(X) \to X$ is affine.
If $X' \cap \sigma(X) = \emptyset$, then $X' \to X$ is both affine
and proper, hence finite
(Morphisms, Lemma \ref{morphisms-lemma-finite-proper}),
hence an isomorphism (as $X$ is normal, see
Morphisms, Lemma \ref{morphisms-lemma-finite-birational-over-normal}).
This is impossible as mentioned above.

\medskip\noindent
Let $X^\nu$ be the normalization of $X'$.
Since $A$ is Nagata, we see that $X^\nu \to X'$ is finite
(Morphisms, Lemmas \ref{morphisms-lemma-nagata-normalization} and
\ref{morphisms-lemma-ubiquity-nagata}). Let $Z \subset X^\nu$ be the
pullback of the effective Cartier divisor $\sigma(X) \subset P$.
By the above we see that $Z$ is not empty and is contained
in the closed fibre of $X^\nu \to S$.
Since $P \to X$ is smooth, we see that $\sigma(X)$ is an effective
Cartier divisor
(Divisors, Lemma \ref{divisors-lemma-section-smooth-regular-immersion}).
Hence $Z \subset X^\nu$ is an effective Cartier divisor too.
Since the conormal sheaf of $\sigma(X)$ in $P$ is $\mathcal{O}_X$, the
conormal sheaf of $Z$ in $X^\nu$ (which is a priori invertible)
is $\mathcal{O}_Z$ by
Morphisms, Lemma \ref{morphisms-lemma-conormal-functorial-flat}.
This is impossible by
Lemma \ref{lemma-nontrivial-normal-bundle}
and the proof is complete.
\end{proof}

\begin{lemma}
\label{lemma-R1-injective}
In Situation \ref{situation-vanishing} assume $X$ is normal and $A$ Nagata.
Then
$$
\Hom_{D(A)}(\kappa[-1], Rf_*\mathcal{O}_X)
$$
is zero. This uses $D(A) = D_\QCoh(\mathcal{O}_S)$ to think of
$Rf_*\mathcal{O}_X$ as an object of $D(A)$.
\end{lemma}

\begin{proof}
By adjointness of $Rf_*$ and $Lf^*$ such a map is the same thing
as a map $\alpha : Lf^*\kappa[-1] \to \mathcal{O}_X$. Note that
$$
H^i(Lf^*\kappa[-1]) =
\left\{
\begin{matrix}
0 & \text{if} & i > 1 \\
\mathcal{O}_{X_s} & \text{if} & i = 1 \\
\text{some }\mathcal{O}_{X_s}\text{-module} & \text{if} & i \leq 0
\end{matrix}
\right.
$$
Since $\Hom(H^0(Lf^*\kappa[-1]), \mathcal{O}_X) = 0$ as $\mathcal{O}_X$
is torsion free, the spectral sequence for $\Ext$
(Cohomology on Sites, Example
\ref{sites-cohomology-example-hom-complex-into-sheaf})
implies that
$\Hom_{D(\mathcal{O}_X)}(Lf^*\kappa[-1], \mathcal{O}_X)$ is equal to
$\Ext^1_{\mathcal{O}_X}(\mathcal{O}_{X_s}, \mathcal{O}_X)$.
We conclude that
$\alpha : Lf^*\kappa[-1] \to \mathcal{O}_X$ is given by an extension
$$
0 \to \mathcal{O}_X \to \mathcal{E} \to \mathcal{O}_{X_s} \to 0
$$
By Lemma \ref{lemma-H1-injective} the pullback of this extension
via the surjection $\mathcal{O}_X \to \mathcal{O}_{X_s}$ is zero
(since this pullback is clearly split over $f^{-1}(U)$).
Thus $1 \in \mathcal{O}_{X_s}$ lifts to a global section $s$ of
$\mathcal{E}$. Multiplying $s$ by the ideal sheaf $\mathcal{I}$
of $X_s$ we obtain an $\mathcal{O}_X$-module map
$c_s : \mathcal{I} \to \mathcal{O}_X$. Applying $f_*$ we obtain
an $A$-linear map $f_*c_s : \mathfrak m \to A$. Since $A$ is
a Noetherian normal local domain this map is given by multiplication
by an element $a \in A$. Changing $s$ into $s -  a$ we find that
$s$ is annihilated by $\mathcal{I}$ and the extension is trivial
as desired.
\end{proof}

\begin{remark}
\label{remark-dualizing-setup}
Let $X$ be an integral Noetherian normal scheme of dimension $2$.
In this case the following are equivalent
\begin{enumerate}
\item $X$ has a dualizing complex $\omega_X^\bullet$,
\item there is a coherent $\mathcal{O}_X$-module $\omega_X$ such that
$\omega_X[n]$ is a dualizing complex, where $n$ can be any integer.
\end{enumerate}
This follows from the fact that $X$ is Cohen-Macaulay
(Properties, Lemma \ref{properties-lemma-normal-dimension-2-Cohen-Macaulay}) and
Duality for Schemes, Lemma \ref{duality-lemma-dualizing-module-CM-scheme}.
In this situation we will say that $\omega_X$ is a {\it dualizing module}
in accordance with
Duality for Schemes, Section \ref{duality-section-dualizing-module}.
In particular, when $A$ is a Noetherian normal local domain of dimension
$2$, then we say {\it $A$ has a dualizing module $\omega_A$}
if the above is true. In this case, if $X \to \Spec(A)$ is a normal
modification, then $X$ has a dualizing module too, see
Duality for Schemes, Example \ref{duality-example-proper-over-local}.
In this situation we always denote $\omega_X$ the dualizing
module normalized with respect to $\omega_A$, i.e., such that
$\omega_X[2]$ is the dualizing complex normalized relative to
$\omega_A[2]$. See Duality for Schemes, Section \ref{duality-section-glue}.
\end{remark}

\noindent
The Grauert-Riemenschneider vanishing of the next proposition is a formal
consequence of Lemma \ref{lemma-R1-injective} and the general theory of
duality.

\begin{proposition}[Grauert-Riemenschneider]
\label{proposition-Grauert-Riemenschneider}
In Situation \ref{situation-vanishing} assume
\begin{enumerate}
\item $X$ is a normal scheme,
\item $A$ is Nagata and has a dualizing complex $\omega_A^\bullet$.
\end{enumerate}
Let $\omega_X$ be the dualizing module of $X$
(Remark \ref{remark-dualizing-setup}). Then $R^1f_*\omega_X = 0$.
\end{proposition}

\begin{proof}
In this proof we will use the identification $D(A) = D_\QCoh(\mathcal{O}_S)$
to identify quasi-coherent $\mathcal{O}_S$-modules with $A$-modules.
Moreover, we may assume that $\omega_A^\bullet$ is normalized, see
Dualizing Complexes, Section \ref{dualizing-section-dualizing-local}.
Since $X$ is a Noetherian normal $2$-dimensional scheme
it is Cohen-Macaulay (Properties, Lemma
\ref{properties-lemma-normal-dimension-2-Cohen-Macaulay}).
Thus $\omega_X^\bullet = \omega_X[2]$ (Duality for Schemes, Lemma
\ref{duality-lemma-dualizing-module-CM-scheme} and the
normalization in Duality for Schemes, Example
\ref{duality-example-proper-over-local}).
If the proposition is false, then we can find a nonzero map
$R^1f_*\omega_X \to \kappa$. In other words we obtain a nonzero map
$\alpha : Rf_*\omega_X^\bullet \to \kappa[1]$.
Applying $R\Hom_A(-, \omega_A^\bullet)$ we get a nonzero map
$$
\beta : \kappa[-1] \longrightarrow Rf_*\mathcal{O}_X
$$
which is impossible by Lemma \ref{lemma-R1-injective}.
To see that $R\Hom_A(-, \omega_A^\bullet)$ does what we said, first
note that
$$
R\Hom_A(\kappa[1], \omega_A^\bullet) =
R\Hom_A(\kappa, \omega_A^\bullet)[-1] =
\kappa[-1]
$$
as $\omega_A^\bullet$ is normalized and we have
$$
R\Hom_A(Rf_*\omega_X^\bullet, \omega_A^\bullet) =
Rf_*R\SheafHom_{\mathcal{O}_X}(\omega_X^\bullet, \omega_X^\bullet) =
Rf_*\mathcal{O}_X
$$
The first equality by
Duality for Schemes, Example \ref{duality-example-iso-on-RSheafHom-noetherian}
and the fact that $\omega_X^\bullet = f^!\omega_A^\bullet$
by construction, and the second equality because $\omega_X^\bullet$
is a dualizing complex for $X$ (which goes back to
Duality for Schemes, Lemma \ref{duality-lemma-shriek-dualizing}).
\end{proof}





\section{Boundedness}
\label{section-bounded}

\noindent
In this section we begin the discussion which will lead to a reduction to
the case of rational singularities for $2$-dimensional schemes.

\begin{lemma}
\label{lemma-exact-sequence}
Let $(A, \mathfrak m, \kappa)$ be a Noetherian normal local domain
of dimension $2$. Consider a commutative diagram
$$
\xymatrix{
X' \ar[rd]_{f'} \ar[rr]_g & & X \ar[ld]^f \\
& \Spec(A)
}
$$
where $f$ and $f'$ are modifications as in Situation \ref{situation-vanishing}
and $X$ normal. Then we have a short exact sequence
$$
0 \to H^1(X, \mathcal{O}_X) \to H^1(X', \mathcal{O}_{X'}) \to
H^0(X, R^1g_*\mathcal{O}_{X'}) \to 0
$$
Also $\dim(\text{Supp}(R^1g_*\mathcal{O}_{X'})) = 0$
and $R^1g_*\mathcal{O}_{X'}$ is generated by global sections.
\end{lemma}

\begin{proof}
We will use the observations made following Situation \ref{situation-vanishing}
without further mention. As $X$ is normal and $g$ is dominant and
birational, we have $g_*\mathcal{O}_{X'} = \mathcal{O}_X$, see for
example More on Morphisms, Lemma
\ref{more-morphisms-lemma-geometrically-connected-fibres-towards-normal}.
Since the fibres of $g$ have dimension $\leq 1$, we have
$R^pg_*\mathcal{O}_{X'} = 0$ for $p > 1$, see for example
Cohomology of Schemes, Lemma
\ref{coherent-lemma-higher-direct-images-zero-above-dimension-fibre}.
The support of $R^1g_*\mathcal{O}_{X'}$ is contained in the set of points of
$X$ where the fibres of $g'$ have dimension $\geq 1$. Thus
it is contained in the set of images of those
irreducible components $C' \subset X'_s$ which map to points of $X_s$
which is a finite set of closed points
(recall that $X'_s \to X_s$ is a morphism of proper $1$-dimensional
schemes over $\kappa$). Then $R^1g_*\mathcal{O}_{X'}$ is globally
generated by
Cohomology of Schemes, Lemma \ref{coherent-lemma-coherent-support-dimension-0}.
Using the morphism $f : X \to S$ and the references above we find that
$H^p(X, \mathcal{F}) = 0$ for $p > 1$ for any coherent $\mathcal{O}_X$-module
$\mathcal{F}$. Hence the short exact sequence of the lemma is a consequence
of the Leray spectral sequence for $g$ and $\mathcal{O}_{X'}$, see
Cohomology, Lemma \ref{cohomology-lemma-Leray}.
\end{proof}

\begin{lemma}
\label{lemma-bound-a-torsion}
Let $(A, \mathfrak m, \kappa)$ be a local normal Nagata domain
of dimension $2$. Let $a \in A$ be nonzero. There exists an integer $N$ such
that for every modification $f : X \to \Spec(A)$ with $X$ normal the
$A$-module
$$
M_{X, a} = \Coker(A \longrightarrow H^0(Z, \mathcal{O}_Z))
$$
where $Z \subset X$ is cut out by $a$ has length bounded by $N$.
\end{lemma}

\begin{proof}
By the short exact sequence
$
0 \to \mathcal{O}_X \xrightarrow{a} \mathcal{O}_X \to \mathcal{O}_Z \to 0
$
we see that
\begin{equation}
\label{equation-a-torsion}
M_{X, a} = H^1(X, \mathcal{O}_X)[a]
\end{equation}
Here $N[a] = \{n \in N \mid an = 0\}$ for an $A$-module $N$. Thus
if $a$ divides $b$, then $M_{X, a} \subset M_{X, b}$.
Suppose that for some $c \in A$ the modules $M_{X, c}$
have bounded length. Then for every $X$ we have an exact sequence
$$
0 \to M_{X, c} \to M_{X, c^2} \to M_{X, c}
$$
where the second arrow is given by multiplication by $c$. Hence we see that
$M_{X, c^2}$ has bounded length as well. Thus it suffices to find a $c \in A$
for which the lemma is true such that $a$ divides $c^n$ for some $n > 0$.
By More on Algebra, Lemma \ref{more-algebra-lemma-divides-radical}
we may assume $A/(a)$ is a reduced ring.

\medskip\noindent
Assume that $A/(a)$ is reduced. Let $A/(a) \subset B$ be the normalization
of $A/(a)$ in its quotient ring. Because $A$ is Nagata, we see that
$\Coker(A \to B)$ is finite. We claim the length of this finite
module is a bound. To see this, consider $f : X \to \Spec(A)$ as in the lemma
and let $Z' \subset Z$ be the scheme theoretic closure of $Z \cap f^{-1}(U)$.
Then $Z' \to \Spec(A/(a))$ is finite for example by Varieties, Lemma
\ref{varieties-lemma-finite-in-codim-1}.
Hence $Z' = \Spec(B')$ with $A/(a) \subset B' \subset B$.
On the other hand, we claim the map
$$
H^0(Z, \mathcal{O}_Z) \to H^0(Z', \mathcal{O}_{Z'})
$$
is injective. Namely, if $s \in H^0(Z, \mathcal{O}_Z)$
is in the kernel, then
the restriction of $s$ to $f^{-1}(U) \cap Z$ is zero.
Hence the image of $s$ in $H^1(X, \mathcal{O}_X)$ vanishes in
$H^1(f^{-1}(U), \mathcal{O}_X)$. By Lemma \ref{lemma-H1-injective}
we see that $s$ comes from an element $\tilde s$ of $A$. But by
assumption $\tilde s$ maps to zero in $B'$ which implies that $s = 0$.
Putting everything together we see that
$M_{X, a}$ is a subquotient of $B'/A$, namely not every element
of $B'$ extends to a global section of $\mathcal{O}_Z$, but in
any case the length of $M_{X, a}$ is bounded by the length of $B/A$.
\end{proof}

\noindent
In some cases, resolution of singularities reduces to the case
of rational singularities.

\begin{definition}
\label{definition-reduce-to-rational}
Let $(A, \mathfrak m, \kappa)$ be a local normal Nagata domain
of dimension $2$.
\begin{enumerate}
\item We say $A$ {\it defines a rational singularity} if for every
normal modification $X \to \Spec(A)$ we have $H^1(X, \mathcal{O}_X) = 0$.
\item We say that {\it reduction to rational singularities
is possible for $A$} if the length of the $A$-modules
$$
H^1(X, \mathcal{O}_X)
$$
is bounded for all modifications $X \to \Spec(A)$ with $X$ normal.
\end{enumerate}
\end{definition}

\noindent
The meaning of the language in (2) is explained by
Lemma \ref{lemma-reduce-to-rational}. The following lemma
says roughly speaking that local rings of modifications of $\Spec(A)$
with $A$ defining a rational singularity also define rational
singularities.

\begin{lemma}
\label{lemma-rational-propagates}
Let $(A, \mathfrak m, \kappa)$ be a local normal Nagata domain of
dimension $2$ which defines a rational singularity. Let $A \subset B$
be a local extension of domains with the same fraction field
which is essentially of finite type such
that $\dim(B) = 2$ and $B$ normal. Then $B$ defines a rational singularity.
\end{lemma}

\begin{proof}
Choose a finite type $A$-algebra $C$ such that $B = C_\mathfrak q$
for some prime $\mathfrak q \subset C$. After replacing
$C$ by the image of $C$ in $B$ we may assume that $C$ is a domain
with fraction field equal to the fraction field of $A$.
Then we can choose a closed immersion $\Spec(C) \to \mathbf{A}^n_A$
and take the closure in $\mathbf{P}^n_A$ to conclude that $B$
is isomorphic to $\mathcal{O}_{X, x}$ for some closed point $x \in X$
of a projective modification $X \to \Spec(A)$.
(Morphisms, Lemma \ref{morphisms-lemma-dimension-formula},
shows that $\kappa(x)$ is finite over $\kappa$ and then
Morphisms, Lemma
\ref{morphisms-lemma-algebraic-residue-field-extension-closed-point-fibre}
shows that $x$ is a closed point.)
Let $\nu : X^\nu \to X$ be the normalization.
Since $A$ is Nagata the morphism $\nu$ is finite (Morphisms, Lemma
\ref{morphisms-lemma-nagata-normalization}).
Thus $X^\nu$ is projective over $A$ by
More on Morphisms, Lemma
\ref{more-morphisms-lemma-category-projective}.
Since $B = \mathcal{O}_{X, x}$ is normal, we see that
$\mathcal{O}_{X, x} = (\nu_*\mathcal{O}_{X^\nu})_x$.
Hence there is a unique point $x^\nu \in X^\nu$ lying over $x$
and $\mathcal{O}_{X^\nu, x^\nu} = \mathcal{O}_{X, x}$.
Thus we may assume $X$ is normal and projective over $A$.
Let $Y \to \Spec(\mathcal{O}_{X, x}) = \Spec(B)$
be a modification with $Y$ normal.
We have to show that $H^1(Y, \mathcal{O}_Y) = 0$. By
Limits, Lemma \ref{limits-lemma-modifications}
we can find a morphism of schemes $g : X' \to X$ which is an isomorphism
over $X \setminus \{x\}$ such that $X' \times_X \Spec(\mathcal{O}_{X, x})$
is isomorphic to $Y$. Then $g$ is a modification as it is proper by
Limits, Lemma \ref{limits-lemma-modifications-properties}.
The local ring of $X'$ at a point of $x'$ is either isomorphic
to the local ring of $X$ at $g(x')$ if $g(x') \not = x$ and
if $g(x') = x$, then the local ring of $X'$ at $x'$ is isomorphic
to the local ring of $Y$ at the corresponding point. Hence we see
that $X'$ is normal as both $X$ and $Y$ are normal.
Thus $H^1(X', \mathcal{O}_{X'}) = 0$ by our assumption on $A$.
By Lemma \ref{lemma-exact-sequence} we have $R^1g_*\mathcal{O}_{X'} = 0$.
Clearly this means that $H^1(Y, \mathcal{O}_Y) = 0$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-reduce-to-rational}
Let $(A, \mathfrak m, \kappa)$ be a local normal Nagata domain
of dimension $2$. If reduction to rational singularities is possible
for $A$, then there exists a finite sequence of normalized blowups
$$
X = X_n \to X_{n - 1} \to \ldots \to X_1 \to X_0 = \Spec(A)
$$
in closed points such that for any closed point $x \in X$
the local ring $\mathcal{O}_{X, x}$ defines a rational singularity.
In particular $X \to \Spec(A)$ is a modification and $X$
is a normal scheme projective over $A$.
\end{lemma}

\begin{proof}
We choose a modification $X \to \Spec(A)$ with $X$ normal
which maximizes the length of $H^1(X, \mathcal{O}_X)$.
By Lemma \ref{lemma-exact-sequence}
for any further modification $g : X' \to X$ with $X'$ normal
we have $R^1g_*\mathcal{O}_{X'} = 0$ and
$H^1(X, \mathcal{O}_X) = H^1(X', \mathcal{O}_{X'})$.

\medskip\noindent
Let $x \in X$ be a closed point. We will show that $\mathcal{O}_{X, x}$
defines a rational singularity. Let $Y \to \Spec(\mathcal{O}_{X, x})$
be a modification with $Y$ normal. We have to show that
$H^1(Y, \mathcal{O}_Y) = 0$. By
Limits, Lemma \ref{limits-lemma-modifications}
we can find a morphism of schemes $g : X' \to X$ which is an isomorphism
over $X \setminus \{x\}$ such that $X' \times_X \Spec(\mathcal{O}_{X, x})$
is isomorphic to $Y$. Then $g$ is a modification as it is proper by
Limits, Lemma \ref{limits-lemma-modifications-properties}.
The local ring of $X'$ at a point of $x'$ is either isomorphic
to the local ring of $X$ at $g(x')$ if $g(x') \not = x$ and
if $g(x') = x$, then the local ring of $X'$ at $x'$ is isomorphic
to the local ring of $Y$ at the corresponding point. Hence we see
that $X'$ is normal as both $X$ and $Y$ are normal. By maximality
we have $R^1g_*\mathcal{O}_{X'} = 0$ (see first paragraph). Clearly
this means that $H^1(Y, \mathcal{O}_Y) = 0$ as desired.

\medskip\noindent
The conclusion is that we've found one normal modification $X$
of $\Spec(A)$ such that the local rings of $X$ at closed points all define
rational singularities. Then we choose a sequence of normalized
blowups $X_n \to \ldots \to X_1 \to \Spec(A)$ such that $X_n$
dominates $X$, see Lemma \ref{lemma-dominate-by-normalized-blowing-up}.
For a closed point $x' \in X_n$ mapping to $x \in X$ we can apply
Lemma \ref{lemma-rational-propagates} to the ring map
$\mathcal{O}_{X, x} \to \mathcal{O}_{X_n, x'}$
to see that $\mathcal{O}_{X_n, x'}$ defines a rational singularity.
\end{proof}

\begin{lemma}
\label{lemma-go-up-separable}
Let $A \to B$ be a finite injective local ring map of local normal
Nagata domains of dimension $2$. Assume that the induced extension of
fraction fields is separable. If reduction to rational singularities
is possible for $A$ then it is possible for $B$.
\end{lemma}

\begin{proof}
Let $n$ be the degree of the fraction field extension $L/K$.
Let $\text{Trace}_{L/K} : L \to K$ be the trace. Since the extension is finite
separable the trace pairing $(h, g) \mapsto \text{Trace}_{L/K}(fg)$
is a nondegenerate bilinear form on $L$ over $K$. See
Fields, Lemma \ref{fields-lemma-separable-trace-pairing}.
Pick $b_1, \ldots, b_n \in B$ which form a basis of $L$ over $K$.
By the above $d = \det(\text{Trace}_{L/K}(b_ib_j)) \in A$ is nonzero.

\medskip\noindent
Let $Y \to \Spec(B)$ be a modification with $Y$ normal. We can find
a $U$-admissible blowup $X'$ of $\Spec(A)$ such that the strict transform
$Y'$ of $Y$ is finite over $X'$, see More on Flatness, Lemma
\ref{flat-lemma-finite-after-blowing-up}. Picture
$$
\xymatrix{
Y' \ar[d] \ar[r] & Y \ar[r] & \Spec(B) \ar[d] \\
X' \ar[rr] & & \Spec(A)
}
$$
After replacing $X'$ and $Y'$ by their normalizations we may assume that
$X'$ and $Y'$ are normal modifications of $\Spec(A)$ and $\Spec(B)$.
In this way we reduce to the case where there exists a commutative diagram
$$
\xymatrix{
Y \ar[d]_\pi \ar[r]_-g & \Spec(B) \ar[d] \\
X \ar[r]^-f & \Spec(A)
}
$$
with $X$ and $Y$ normal modifications of $\Spec(A)$ and $\Spec(B)$ and
$\pi$ finite.

\medskip\noindent
The trace map on $L$ over $K$ extends to a map of $\mathcal{O}_X$-modules
$\text{Trace} : \pi_*\mathcal{O}_Y \to \mathcal{O}_X$. Consider the map
$$
\Phi : \pi_*\mathcal{O}_Y \longrightarrow \mathcal{O}_X^{\oplus n},\quad
s \longmapsto (\text{Trace}(b_1s), \ldots, \text{Trace}(b_ns))
$$
This map is injective (because it is injective in the generic point)
and there is a map
$$
\mathcal{O}_X^{\oplus n} \longrightarrow \pi_*\mathcal{O}_Y,\quad
(s_1, \ldots, s_n) \longmapsto \sum b_i s_i
$$
whose composition with $\Phi$ has matrix $\text{Trace}(b_ib_j)$.
Hence the cokernel of $\Phi$ is annihilated by $d$. Thus we see that
we have an exact sequence
$$
H^0(X, \Coker(\Phi)) \to H^1(Y, \mathcal{O}_Y) \to
H^1(X, \mathcal{O}_X)^{\oplus n}
$$
Since the right hand side is bounded by assumption, it suffices to show
that the $d$-torsion in $H^1(Y, \mathcal{O}_Y)$ is bounded.
This is the content of Lemma \ref{lemma-bound-a-torsion} and
(\ref{equation-a-torsion}).
\end{proof}

\begin{lemma}
\label{lemma-regular-rational}
Let $A$ be a Nagata regular local ring of dimension $2$. Then $A$ defines
a rational singularity.
\end{lemma}

\begin{proof}
(The assumption that $A$ be Nagata is not necessary for this proof,
but we've only defined the notion of rational singularity in the
case of Nagata $2$-dimensional normal local domains.)
Let $X \to \Spec(A)$ be a modification with $X$ normal. By
Lemma \ref{lemma-dominate-by-blowing-up-in-points}
we can dominate $X$ by a scheme $X_n$ which is the last in a sequence
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to X_0 = \Spec(A)
$$
of blowing ups in closed points. By Lemma \ref{lemma-blowup-regular}
the schemes $X_i$ are regular, in particular
normal (Algebra, Lemma \ref{algebra-lemma-regular-normal}).
By Lemma \ref{lemma-exact-sequence} we have
$H^1(X, \mathcal{O}_X) \subset H^1(X_n, \mathcal{O}_{X_n})$.
Thus it suffices to prove $H^1(X_n, \mathcal{O}_{X_n}) = 0$.
Using Lemma \ref{lemma-exact-sequence} again, we
see that it suffices to prove $R^1(X_i \to X_{i - 1})_*\mathcal{O}_{X_i} = 0$
for $i = 1, \ldots, n$. This follows from
Lemma \ref{lemma-cohomology-of-blowup}.
\end{proof}

\begin{lemma}
\label{lemma-bound-dualizing-implies-bound}
Let $A$ be a local normal Nagata domain of dimension $2$ which has a
dualizing complex $\omega_A^\bullet$. If there exists a nonzero $d \in A$
such that for all normal modifications $X \to \Spec(A)$ the cokernel of the
trace map
$$
\Gamma(X, \omega_X) \to \omega_A
$$
is annihilated by $d$, then reduction to rational singularities
is possible for $A$.
\end{lemma}

\begin{proof}
For $X \to \Spec(A)$ as in the statement we have to bound
$H^1(X, \mathcal{O}_X)$. Let $\omega_X$ be the dualizing module
of $X$ as in the statement of Grauert-Riemenschneider
(Proposition \ref{proposition-Grauert-Riemenschneider}).
The trace map is the map $Rf_*\omega_X \to \omega_A$ described
in Duality for Schemes, Section \ref{duality-section-trace}.
By Grauert-Riemenschneider we have $Rf_*\omega_X = f_*\omega_X$
thus the trace map indeed produces a map $\Gamma(X, \omega_X) \to \omega_A$.
By duality we have $Rf_*\omega_X = R\Hom_A(Rf_*\mathcal{O}_X, \omega_A)$
(this uses that $\omega_X[2]$ is the dualizing complex on $X$
normalized relative to $\omega_A[2]$,
see Duality for Schemes, Lemma \ref{duality-lemma-duality-bootstrap}
or more directly Section \ref{duality-section-duality} or even more directly
Example \ref{duality-example-iso-on-RSheafHom-noetherian}).
The distinguished triangle
$$
A \to Rf_*\mathcal{O}_X \to R^1f_*\mathcal{O}_X[-1] \to A[1]
$$
is transformed by $R\Hom_A(-, \omega_A)$ into the short exact sequence
$$
0 \to f_*\omega_X \to \omega_A \to
\Ext_A^2(R^1f_*\mathcal{O}_X, \omega_A) \to 0
$$
(and $\Ext_A^i(R^1f_*\mathcal{O}_X, \omega_A) = 0$ for $i \not = 2$;
this will follow from the discussion below as well).
Since $R^1f_*\mathcal{O}_X$ is supported in $\{\mathfrak m\}$, the
local duality theorem tells us that
$$
\Ext_A^2(R^1f_*\mathcal{O}_X, \omega_A) =
\Ext_A^0(R^1f_*\mathcal{O}_X, \omega_A[2]) =
\Hom_A(R^1f_*\mathcal{O}_X, E)
$$
is the Matlis dual of $R^1f_*\mathcal{O}_X$ (and the other
ext groups are zero), see
Dualizing Complexes, Lemma \ref{dualizing-lemma-special-case-local-duality}.
By the equivalence of categories inherent in Matlis duality
(Dualizing Complexes, Proposition \ref{dualizing-proposition-matlis}),
if $R^1f_*\mathcal{O}_X$ is not annihilated by $d$,
then neither is the $\Ext^2$ above. Hence we see that
$H^1(X, \mathcal{O}_X)$ is annihilated by $d$. Thus the required
boundedness follows from Lemma \ref{lemma-bound-a-torsion} and
(\ref{equation-a-torsion}).
\end{proof}

\begin{lemma}
\label{lemma-compare-differentials-dualizing}
Let $p$ be a prime number.
Let $A$ be a regular local ring of dimension $2$ and characteristic $p$.
Let $A_0 \subset A$ be a subring such that $\Omega_{A/A_0}$ is free
of rank $r < \infty$. Set $\omega_A = \Omega^r_{A/A_0}$. If $X \to \Spec(A)$
is the result of a sequence of blowups in closed points, then
there exists a map
$$
\varphi_X : (\Omega^r_{X/\Spec(A_0)})^{**} \longrightarrow \omega_X
$$
extending the given identification in the generic point.
\end{lemma}

\begin{proof}
Observe that $A$ is Gorenstein (Dualizing Complexes,
Lemma \ref{dualizing-lemma-regular-gorenstein})
and hence the invertible module $\omega_A$ does indeed serve
as a dualizing module. Moreover, any $X$ as in the lemma
has an invertible dualizing module $\omega_X$ as $X$ is regular
(hence Gorenstein) and proper over $A$, see
Remark \ref{remark-dualizing-setup} and
Lemma \ref{lemma-blowup-regular}.
Suppose we have constructed the map
$\varphi_X : (\Omega^r_{X/A_0})^{**} \to \omega_X$
and suppose that $b : X' \to X$ is a blowup in a closed point.
Set $\Omega^r_X = (\Omega^r_{X/A_0})^{**}$ and
$\Omega^r_{X'} = (\Omega^r_{X'/A_0})^{**}$. Since $\omega_{X'} = b^!(\omega_X)$
a map $\Omega^r_{X'} \to \omega_{X'}$ is the same thing as a map
$Rb_*(\Omega^r_{X'}) \to \omega_X$. See discussion in
Remark \ref{remark-dualizing-setup} and
Duality for Schemes, Section \ref{duality-section-duality}.
Thus in turn it suffices to produce a map
$$
Rb_*(\Omega^r_{X'}) \longrightarrow \Omega^r_X
$$
The sheaves $\Omega^r_{X'}$ and $\Omega^r_X$ are invertible, see
Divisors, Lemma \ref{divisors-lemma-reflexive-over-regular-dim-2}.
Consider the exact sequence
$$
b^*\Omega_{X/A_0} \to \Omega_{X'/A_0} \to \Omega_{X'/X} \to 0
$$
A local calculation shows that $\Omega_{X'/X}$ is isomorphic
to an invertible module on the exceptional divisor $E$, see
Lemma \ref{lemma-differentials-of-blowup}. It follows that
either
$$
\Omega^r_{X'} \cong (b^*\Omega^r_X)(E)
\quad\text{or}\quad
\Omega^r_{X'} \cong b^*\Omega^r_X
$$
see Divisors, Lemma \ref{divisors-lemma-wedge-product-ses}.
(The second possibility never happens in characteristic zero, but
can happen in characteristic $p$.) In both cases we see that
$R^1b_*(\Omega^r_{X'}) = 0$ and $b_*(\Omega^r_{X'}) = \Omega^r_X$ by
Lemma \ref{lemma-cohomology-of-blowup}.
\end{proof}

\begin{lemma}
\label{lemma-go-up-degree-p}
Let $p$ be a prime number. Let $A$ be a complete regular local ring of
dimension $2$ and characteristic $p$. Let $L/K$ be a degree $p$ inseparable
extension of the fraction field $K$ of $A$. Let $B \subset L$ be the integral
closure of $A$. Then reduction to rational singularities is possible for $B$.
\end{lemma}

\begin{proof}
We have $A = k[[x, y]]$. Write $L = K[x]/(x^p - f)$ for some $f \in A$
and denote $g \in B$ the congruence class of $x$, i.e., the element such
that $g^p = f$. By Algebra, Lemma \ref{algebra-lemma-derivative-zero-pth-power}
we see that $\text{d}f$ is nonzero in $\Omega_{K/\mathbf{F}_p}$. By
More on Algebra, Lemma \ref{more-algebra-lemma-power-series-ring-subfields}
there exists a subfield $k^p \subset k' \subset k$ with
$p^e = [k : k'] < \infty$ such that $\text{d}f$ is nonzero
in $\Omega_{K/K_0}$ where $K_0$ is the fraction field of
$A_0 = k'[[x^p, y^p]] \subset A$. Then
$$
\Omega_{A/A_0} =
A \otimes_k \Omega_{k/k'} \oplus A \text{d}x \oplus A \text{d}y
$$
is finite free of rank $e + 2$. Set $\omega_A = \Omega^{e + 2}_{A/A_0}$.
Consider the canonical map
$$
\text{Tr} :
\Omega^{e + 2}_{B/A_0}
\longrightarrow
\Omega^{e + 2}_{A/A_0} = \omega_A
$$
of Lemma \ref{lemma-trace-extends}. By duality this determines a map
$$
c : \Omega^{e + 2}_{B/A_0} \to \omega_B = \Hom_A(B, \omega_A)
$$
Claim: the cokernel of $c$ is annihilated by a nonzero element of $B$.

\medskip\noindent
Since $\text{d}f$ is nonzero in $\Omega_{A/A_0}$ we can find
$\eta_1, \ldots, \eta_{e + 1} \in \Omega_{A/A_0}$ such that
$\theta = \eta_1 \wedge \ldots \wedge \eta_{e + 1} \wedge \text{d}f$ is
nonzero in $\omega_A = \Omega^{e + 2}_{A/A_0}$. To prove the claim we
will construct elements $\omega_i$ of $\Omega^{e + 2}_{B/A_0}$,
$i = 0, \ldots, p - 1$ which are mapped to
$\varphi_i \in \omega_B = \Hom_A(B, \omega_A)$
with $\varphi_i(g^j) = \delta_{ij}\theta$ for $j = 0, \ldots, p - 1$.
Since $\{1, g, \ldots, g^{p - 1}\}$ is a basis for $L/K$ this
proves the claim. We set
$\eta = \eta_1 \wedge \ldots \wedge \eta_{e + 1}$
so that $\theta = \eta \wedge \text{d}f$.
Set $\omega_i = \eta \wedge g^{p - 1 - i}\text{d}g$. Then
by construction we have
$$
\varphi_i(g^j) = \text{Tr}(g^j \eta \wedge g^{p - 1 - i}\text{d}g) =
\text{Tr}(\eta \wedge g^{p - 1 - i + j}\text{d}g) = \delta_{ij} \theta
$$
by the explicit description of the trace map in Lemma \ref{lemma-trace-higher}.

\medskip\noindent
Let $Y \to \Spec(B)$ be a normal modification. Exactly as in the proof of
Lemma \ref{lemma-go-up-separable} we can reduce to the case where $Y$
is finite over a modification $X$ of $\Spec(A)$. By
Lemma \ref{lemma-dominate-by-blowing-up-in-points} we may
even assume $X \to \Spec(A)$ is the result of a sequence of
blowing ups in closed points. Picture:
$$
\xymatrix{
Y \ar[d]_\pi \ar[r]_-g & \Spec(B) \ar[d] \\
X \ar[r]^-f & \Spec(A)
}
$$
We may apply Lemma \ref{lemma-trace-extends} to $\pi$ and
we obtain the first arrow in
$$
\pi_*(\Omega^{e + 2}_{Y/A_0})
\xrightarrow{\text{Tr}}
(\Omega^{e + 2}_{X/A_0})^{**}
\xrightarrow{\varphi_X}
\omega_X
$$
and the second arrow is from
Lemma \ref{lemma-compare-differentials-dualizing}
(because $f$ is a sequence of blowups in closed points).
By duality for the finite morphism $\pi$ this corresponds to a map
$$
c_Y : \Omega^{e + 2}_{Y/A_0} \longrightarrow \omega_Y
$$
extending the map $c$ above. Hence we see that the image of
$\Gamma(Y, \omega_Y) \to \omega_B$ contains the image of $c$.
By our claim we see that the cokernel is annihilated by
a fixed nonzero element of $B$. We conclude by
Lemma \ref{lemma-bound-dualizing-implies-bound}.
\end{proof}






\section{Rational singularities}
\label{section-rational-singularities}

\noindent
In this section we reduce from rational singular points to
Gorenstein rational singular points. See \cite{Lipman-rational} and
\cite{Mattuck}.

\begin{situation}
\label{situation-rational}
Here $(A, \mathfrak m, \kappa)$ be a local normal Nagata domain of
dimension $2$ which defines a rational singularity. Let $s$ be the closed
point of $S = \Spec(A)$ and $U = S \setminus \{s\}$. Let $f : X \to S$
be a modification with $X$ normal.
We denote $C_1, \ldots, C_r$ the irreducible
components of the special fibre $X_s$ of $f$.
\end{situation}

\begin{lemma}
\label{lemma-globally-generated}
In Situation \ref{situation-rational}.
Let $\mathcal{F}$ be a quasi-coherent $\mathcal{O}_X$-module. Then
\begin{enumerate}
\item $H^p(X, \mathcal{F}) = 0$ for $p \not \in \{0, 1\}$, and
\item $H^1(X, \mathcal{F}) = 0$ if $\mathcal{F}$ is globally generated.
\end{enumerate}
\end{lemma}

\begin{proof}
Part (1) follows from  Cohomology of Schemes, Lemma
\ref{coherent-lemma-higher-direct-images-zero-above-dimension-fibre}.
If $\mathcal{F}$ is globally generated, then there is a surjection
$\bigoplus_{i \in I} \mathcal{O}_X \to \mathcal{F}$. By part (1)
and the long exact sequence of cohomology this
induces a surjection on $H^1$. Since $H^1(X, \mathcal{O}_X) = 0$
as $S$ has a rational singularity, and since $H^1(X, -)$ commutes
with direct sums
(Cohomology, Lemma \ref{cohomology-lemma-quasi-separated-cohomology-colimit})
we conclude.
\end{proof}

\begin{lemma}
\label{lemma-sections-powers-I-rational}
In Situation \ref{situation-rational} assume
$E = X_s$ is an effective Cartier divisor.
Let $\mathcal{I}$ be the ideal sheaf of $E$. Then
$H^0(X, \mathcal{I}^n) = \mathfrak m^n$ and
$H^1(X, \mathcal{I}^n) = 0$.
\end{lemma}

\begin{proof}
We have $H^0(X, \mathcal{O}_X) = A$, see discussion following
Situation \ref{situation-vanishing}. Then
$\mathfrak m \subset H^0(X, \mathcal{I}) \subset H^0(X, \mathcal{O}_X)$.
The second inclusion is not an equality as $X_s \not = \emptyset$.
Thus $H^0(X, \mathcal{I}) = \mathfrak m$.
As $\mathcal{I}^n = \mathfrak m^n\mathcal{O}_X$ our
Lemma \ref{lemma-globally-generated} shows that $H^1(X, \mathcal{I}^n) = 0$.

\medskip\noindent
Choose generators $x_1, \ldots, x_{\mu + 1}$ of $\mathfrak m$. These define
global sections of $\mathcal{I}$ which generate it. Hence
a short exact sequence
$$
0 \to \mathcal{F} \to \mathcal{O}_X^{\oplus \mu + 1} \to \mathcal{I} \to 0
$$
Then $\mathcal{F}$ is a finite locally free $\mathcal{O}_X$-module
of rank $\mu$ and $\mathcal{F} \otimes \mathcal{I}$ is globally
generated by Constructions, Lemma
\ref{constructions-lemma-globally-generated-omega-twist-1}.
Hence $\mathcal{F} \otimes \mathcal{I}^n$
is globally generated for all $n \geq 1$. Thus for $n \geq 2$ we can
consider the exact sequence
$$
0 \to \mathcal{F} \otimes \mathcal{I}^{n - 1} \to
(\mathcal{I}^{n - 1})^{\oplus \mu + 1} \to
\mathcal{I}^n \to 0
$$
Applying the long exact sequence of cohomology using that
$H^1(X, \mathcal{F} \otimes \mathcal{I}^{n - 1}) = 0$ by
Lemma \ref{lemma-globally-generated}
we obtain that every
element of $H^0(X, \mathcal{I}^n)$ is of the form $\sum x_i a_i$
for some $a_i \in H^0(X, \mathcal{I}^{n - 1})$. This shows that
$H^0(X, \mathcal{I}^n) = \mathfrak m^n$ by induction.
\end{proof}

\begin{lemma}
\label{lemma-blow-up-normal-rational}
In Situation \ref{situation-rational}
the blowup of $\Spec(A)$ in $\mathfrak m$ is normal.
\end{lemma}

\begin{proof}
Let $X' \to \Spec(A)$ be the blowup, in other words
$$
X' = \text{Proj}(A \oplus \mathfrak m \oplus \mathfrak m^2 \oplus \ldots).
$$
is the Proj of the Rees algebra. This in particular shows that
$X'$ is integral and that $X' \to \Spec(A)$ is a projective
modification. Let $X$ be the normalization of $X'$.
Since $A$ is Nagata, we see that $\nu : X \to X'$ is finite
(Morphisms, Lemma \ref{morphisms-lemma-nagata-normalization}).
Let $E' \subset X'$ be the exceptional divisor and let $E \subset X$
be the inverse image. Let $\mathcal{I}' \subset \mathcal{O}_{X'}$
and $\mathcal{I} \subset \mathcal{O}_X$ be their ideal sheaves.
Recall that $\mathcal{I}' = \mathcal{O}_{X'}(1)$
(Divisors, Lemma \ref{divisors-lemma-blowing-up-projective}).
Observe that $\mathcal{I} = \nu^*\mathcal{I}'$ and that $E$ is an
effective Cartier divisor (Divisors, Lemma
\ref{divisors-lemma-pullback-effective-Cartier-defined}).
We are trying to show that $\nu$ is an isomorphism. As $\nu$ is finite,
it suffices to show that $\mathcal{O}_{X'} \to \nu_*\mathcal{O}_X$
is an isomorphism. If not, then we can find an $n \geq 0$ such that
$$
H^0(X', (\mathcal{I}')^n) \not =
H^0(X', (\nu_*\mathcal{O}_X) \otimes (\mathcal{I}')^n)
$$
for example because we can recover quasi-coherent $\mathcal{O}_{X'}$-modules
from their associated graded modules, see
Properties, Lemma \ref{properties-lemma-ample-quasi-coherent}.
By the projection formula we have
$$
H^0(X', (\nu_*\mathcal{O}_X) \otimes (\mathcal{I}')^n) =
H^0(X, \nu^*(\mathcal{I}')^n) =
H^0(X, \mathcal{I}^n) = \mathfrak m^n
$$
the last equality by Lemma \ref{lemma-sections-powers-I-rational}.
On the other hand, there is clearly an injection
$\mathfrak m^n \to H^0(X', (\mathcal{I}')^n)$. Since
$H^0(X', (\mathcal{I}')^n)$ is torsion free we conclude equality holds
for all $n$, hence $X = X'$.
\end{proof}

\begin{lemma}
\label{lemma-cohomology-blow-up-rational}
In Situation \ref{situation-rational}.
Let $X$ be the blowup of $\Spec(A)$ in $\mathfrak m$. Let $E \subset X$
be the exceptional divisor. With $\mathcal{O}_X(1) = \mathcal{I}$ as
usual and $\mathcal{O}_E(1) = \mathcal{O}_X(1)|_E$ we have
\begin{enumerate}
\item $E$ is a proper Cohen-Macaulay curve over $\kappa$.
\item $\mathcal{O}_E(1)$ is very ample
\item $\deg(\mathcal{O}_E(1)) \geq 1$ and equality holds only if
$A$ is a regular local ring,
\item $H^1(E, \mathcal{O}_E(n)) = 0$ for $n \geq 0$, and
\item $H^0(E, \mathcal{O}_E(n)) = \mathfrak m^n/\mathfrak m^{n + 1}$
for $n \geq 0$.
\end{enumerate}
\end{lemma}

\begin{proof}
Since $\mathcal{O}_X(1)$ is very ample by construction, we see that
its restriction to the special fibre $E$ is very ample as well.
By Lemma \ref{lemma-blow-up-normal-rational} the scheme $X$ is normal.
Then $E$ is Cohen-Macaulay by
Divisors, Lemma \ref{divisors-lemma-normal-effective-Cartier-divisor-S1}.
Lemma \ref{lemma-sections-powers-I-rational} applies and we obtain
(4) and (5) from the exact sequences
$$
0 \to \mathcal{I}^{n + 1} \to \mathcal{I}^n \to i_*\mathcal{O}_E(n) \to 0
$$
and the long exact cohomology sequence. In particular, we see that
$$
\deg(\mathcal{O}_E(1)) = \chi(E, \mathcal{O}_E(1)) - \chi(E, \mathcal{O}_E) =
\dim(\mathfrak m/\mathfrak m^2) - 1
$$
by Varieties, Definition \ref{varieties-definition-degree-invertible-sheaf}.
Thus (3) follows as well.
\end{proof}

\begin{lemma}
\label{lemma-dualizing-rational}
In Situation \ref{situation-rational} assume $A$ has a
dualizing complex $\omega_A^\bullet$. With $\omega_X$ the dualizing
module of $X$, the trace map $H^0(X, \omega_X) \to \omega_A$ is an
isomorphism and consequently there is a canonical map
$f^*\omega_A \to \omega_X$.
\end{lemma}

\begin{proof}
By Grauert-Riemenschneider
(Proposition \ref{proposition-Grauert-Riemenschneider}) we see that
$Rf_*\omega_X = f_*\omega_X$. By duality we have a short exact
sequence
$$
0 \to f_*\omega_X \to \omega_A \to
\Ext^2_A(R^1f_*\mathcal{O}_X, \omega_A) \to 0
$$
(for example see proof of Lemma \ref{lemma-bound-dualizing-implies-bound})
and since $A$ defines a rational singularity we obtain
$f_*\omega_X = \omega_A$.
\end{proof}

\begin{lemma}
\label{lemma-dualizing-blow-up-rational}
In Situation \ref{situation-rational} assume $A$ has a
dualizing complex $\omega_A^\bullet$ and is not regular.
Let $X$ be the blowup of $\Spec(A)$ in $\mathfrak m$ with
exceptional divisor $E \subset X$. Let $\omega_X$
be the dualizing module of $X$. Then
\begin{enumerate}
\item $\omega_E = \omega_X|_E \otimes \mathcal{O}_E(-1)$,
\item $H^1(X, \omega_X(n)) = 0$ for $n \geq 0$,
\item the map $f^*\omega_A \to \omega_X$ of
Lemma \ref{lemma-dualizing-rational} is surjective.
\end{enumerate}
\end{lemma}

\begin{proof}
We will use the results of Lemma \ref{lemma-cohomology-blow-up-rational}
without further mention. Observe that
$\omega_E = \omega_X|_E \otimes \mathcal{O}_E(-1)$
by Duality for Schemes, Lemmas
\ref{duality-lemma-sheaf-with-exact-support-effective-Cartier} and
\ref{duality-lemma-twisted-inverse-image-closed}. Thus
$\omega_X|_E = \omega_E(1)$. Consider the short exact sequences
$$
0 \to \omega_X(n + 1) \to \omega_X(n) \to i_*\omega_E(n + 1) \to 0
$$
By Algebraic Curves, Lemma \ref{curves-lemma-vanishing-twist}
we see that $H^1(E, \omega_E(n + 1)) = 0$ for $n \geq 0$.
Thus we see that the maps
$$
\ldots \to H^1(X, \omega_X(2)) \to H^1(X, \omega_X(1)) \to H^1(X, \omega_X)
$$
are surjective. Since $H^1(X, \omega_X(n))$ is zero for $n \gg 0$
(Cohomology of Schemes, Lemma \ref{coherent-lemma-kill-by-twisting})
we conclude that (2) holds.

\medskip\noindent
By Algebraic Curves, Lemma
\ref{curves-lemma-tensor-omega-with-globally-generated-invertible}
we see that $\omega_X|_E = \omega_E \otimes \mathcal{O}_E(1)$
is globally generated. Since we seen above that
$H^1(X, \omega_X(1)) = 0$ the map $H^0(X, \omega_X) \to H^0(E, \omega_X|_E)$
is surjective. We conclude that $\omega_X$ is globally generated
hence (3) holds because $\Gamma(X, \omega_X) = \omega_A$ is used
in Lemma \ref{lemma-dualizing-rational} to define the map.
\end{proof}

\begin{lemma}
\label{lemma-rational-to-gorenstein}
Let $(A, \mathfrak m, \kappa)$ be a local normal Nagata domain of
dimension $2$ which defines a rational singularity. Assume $A$ has
a dualizing complex. Then there exists a finite sequence of blowups in
singular closed points
$$
X = X_n \to X_{n - 1} \to \ldots \to X_1 \to X_0 = \Spec(A)
$$
such that $X_i$ is normal for each $i$ and such that
the dualizing sheaf $\omega_X$ of $X$ is an invertible
$\mathcal{O}_X$-module.
\end{lemma}

\begin{proof}
The dualizing module $\omega_A$ is a finite $A$-module whose stalk at
the generic point is invertible. Namely, $\omega_A \otimes_A K$
is a dualizing module for the fraction field $K$ of $A$, hence has
rank $1$. Thus there exists a blowup $b : Y \to \Spec(A)$ such that
the strict transform of $\omega_A$ with respect to $b$ is an invertible
$\mathcal{O}_Y$-module, see
Divisors, Lemma \ref{divisors-lemma-blowup-fitting-ideal}.
By Lemma \ref{lemma-dominate-by-normalized-blowing-up}
we can choose a sequence of normalized blowups
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to \Spec(A)
$$
such that $X_n$ dominates $Y$. By Lemma \ref{lemma-blow-up-normal-rational}
and arguing by induction each $X_i \to X_{i - 1}$ is simply a blowing up.

\medskip\noindent
We claim that $\omega_{X_n}$ is invertible. Since $\omega_{X_n}$
is a coherent $\mathcal{O}_{X_n}$-module, it suffices to see its stalks
are invertible modules. If $x \in X_n$ is a regular point, then this is
clear from the fact that regular schemes are
Gorenstein (Dualizing Complexes, Lemma
\ref{dualizing-lemma-regular-gorenstein}). If $x$ is a singular point of
$X_n$, then each of the images $x_i \in X_i$ of $x$ is a singular point
(because the blowup of a regular point is regular by
Lemma \ref{lemma-blowup-regular}).
Consider the canonical map $f_n^*\omega_A \to \omega_{X_n}$ of
Lemma \ref{lemma-dualizing-rational}. For each $i$ the morphism
$X_{i + 1} \to X_i$ is either a blowup of $x_i$ or an isomorphism
at $x_i$. Since $x_i$ is always a singular point, it follows from
Lemma \ref{lemma-dualizing-blow-up-rational}
and induction that the maps $f_i^*\omega_A \to \omega_{X_i}$
is always surjective on stalks at $x_i$. Hence
$$
(f_n^*\omega_A)_x \longrightarrow \omega_{X_n, x}
$$
is surjective. On the other hand, by our choice of $b$ the quotient
of $f_n^*\omega_A$ by its torsion submodule is an invertible module
$\mathcal{L}$. Moreover, the dualizing module is torsion free
(Duality for Schemes, Lemma \ref{duality-lemma-dualizing-module}).
It follows that $\mathcal{L}_x \cong  \omega_{X_n, x}$ and the proof is
complete.
\end{proof}






\section{Formal arcs}
\label{section-arcs}

\noindent
Let $X$ be a locally Noetherian scheme. In this section we say that a
{\it formal arc} in $X$ is a morphism $a : T \to X$ where $T$ is the
spectrum of a complete discrete valuation ring $R$ whose residue field
$\kappa$ is identified with the residue field of the image $p$ of the
closed point of $\Spec(R)$. Let us say that the formal arc $a$ is
{\it centered at $p$} in this case. We say the formal arc $T \to X$
is {\it nonsingular} if the induced map
$\mathfrak m_p/\mathfrak m_p^2 \to \mathfrak m_R/\mathfrak m_R^2$
is surjective.

\medskip\noindent
Let $a : T \to X$, $T = \Spec(R)$ be a nonsingular formal arc centered
at a closed point $p$ of $X$. Assume $X$ is locally Noetherian.
Let $b : X_1 \to X$ be the blowing up of $X$ at $x$.
Since $a$ is nonsingular, we see that there is an element
$f \in \mathfrak m_p$ which maps to a uniformizer in $R$.
In particular, we find that the generic point of $T$ maps to
a point of $X$ not equal to $p$. In other words, with $K$
the fraction field of $R$, the restriction of $a$ defines a morphism
$\Spec(K) \to X \setminus \{p\}$. Since the morphism $b$ is
proper and an isomorphism over $X \setminus \{x\}$ we can apply
the valuative criterion of properness to obtain a unique morphism
$a_1$ making the following diagram commute
$$
\xymatrix{
T \ar[r]_{a_1} \ar[rd]_a & X_1 \ar[d]^{b} \\
& X
}
$$
Let $p_1 \in X_1$ be the image of the closed point of $T$. Observe that
$p_1$ is a closed point as it is a $\kappa = \kappa(p)$-rational point
on the fibre of $X_1 \to X$ over $x$. Since we have a factorization
$$
\mathcal{O}_{X, x} \to \mathcal{O}_{X_1, p_1} \to R
$$
we see that $a_1$ is a nonsingular formal arc as well.

\medskip\noindent
We can repeat the process and obtain a sequence of blowing ups
$$
\xymatrix{
T \ar[d]_a \ar[rd]_{a_1} \ar[rrd]_{a_2} \ar[rrrd]^{a_3} \\
(X, p) & (X_1, p_1) \ar[l] & (X_2, p_2) \ar[l] &
(X_3, p_3) \ar[l] & \ldots \ar[l]
}
$$
This kind of sequence of blowups can be characterized as follows.

\begin{lemma}
\label{lemma-sequence-blowups}
Let $X$ be a locally Noetherian scheme. Let
$$
(X, p) = (X_0, p_0) \leftarrow (X_1, p_1) \leftarrow (X_2, p_2) \leftarrow
(X_3, p_3) \leftarrow \ldots
$$
be a sequence of blowups such that
\begin{enumerate}
\item $p_i$ is closed, maps to $p_{i - 1}$, and
$\kappa(p_i) = \kappa(p_{i - 1})$,
\item there exists an $x_1 \in \mathfrak m_p$ whose image
in $\mathfrak m_{p_i}$, $i > 0$ defines the exceptional divisor
$E_i \subset X_i$.
\end{enumerate}
Then the sequence is obtained from a nonsingular arc $a : T \to X$
as above.
\end{lemma}

\begin{proof}
Let us write $\mathcal{O}_n = \mathcal{O}_{X_n, p_n}$
and $\mathcal{O} = \mathcal{O}_{X, p}$. Denote
$\mathfrak m \subset \mathcal{O}$ and $\mathfrak m_n \subset \mathcal{O}_n$
the maximal ideals.

\medskip\noindent
We claim that $x_1^t \not \in \mathfrak m_n^{t + 1}$.
Namely, if this were the case, then in the local ring
$\mathcal{O}_{n + 1}$ the element $x_1^t$ would be in the ideal of
$(t + 1)E_{n + 1}$.
This contradicts the assumption that $x_1$ defines $E_{n + 1}$.

\medskip\noindent
For every $n$ choose generators $y_{n, 1}, \ldots, y_{n, t_n}$
for $\mathfrak m_n$. As
$\mathfrak m_n \mathcal{O}_{n + 1} = x_1\mathcal{O}_{n + 1}$
by assumption (2), we can write $y_{n, i} = a_{n, i} x_1$
for some $a_{n, i} \in \mathcal{O}_{n + 1}$. Since
the map $\mathcal{O}_n \to \mathcal{O}_{n + 1}$ defines
an isomorphism on residue fields by (1) we can choose
$c_{n, i} \in \mathcal{O}_n$ having the same residue class as
$a_{n, i}$. Then we see that
$$
\mathfrak m_n = (x_1, z_{n, 1}, \ldots, z_{n, t_n}),
\quad z_{n, i} = y_{n, i} - c_{n, i} x_1
$$
and the elements $z_{n, i}$ map to elements of $\mathfrak m_{n + 1}^2$
in $\mathcal{O}_{n + 1}$.

\medskip\noindent
Let us consider
$$
J_n = \Ker(\mathcal{O} \to \mathcal{O}_n/\mathfrak m_n^{n + 1})
$$
We claim that $\mathcal{O}/J_n$ has length $n + 1$ and that
$\mathcal{O}/(x_1) + J_n$ equals the residue field. For $n = 0$
this is immediate. Assume the statement holds for $n$.
Let $f \in J_n$. Then in $\mathcal{O}_n$ we have
$$
f = a x_1^{n + 1} + x_1^n A_1(z_{n, i}) +
x_1^{n - 1} A_2(z_{n, i}) + \ldots + A_{n + 1}(z_{n, i})
$$
for some $a \in \mathcal{O}_n$ and some $A_i$ homogeneous of degree $i$
with coefficients in $\mathcal{O}_n$. Since $\mathcal{O} \to \mathcal{O}_n$
identifies residue fields, we may choose $a \in \mathcal{O}$
(argue as in the construction of $z_{n, i}$ above).
Taking the image in
$\mathcal{O}_{n + 1}$ we see that $f$ and $a x_1^{n + 1}$
have the same image modulo $\mathfrak m_{n + 1}^{n + 2}$.
Since $x_n^{n + 1} \not \in \mathfrak m_{n + 1}^{n + 2}$
it follows that $J_n/J_{n + 1}$ has length $1$ and the claim is true.

\medskip\noindent
Consider $R = \lim \mathcal{O}/J_n$. This is a quotient of
the $\mathfrak m$-adic completion of $\mathcal{O}$ hence it is
a complete Noetherian local ring. On the other hand, it is
not finite length and $x_1$ generates the maximal ideal.
Thus $R$ is a complete discrete valuation ring.
The map $\mathcal{O} \to R$ lifts to a local homomorphism
$\mathcal{O}_n \to R$ for every $n$. There are two ways to show this:
(1) for every $n$ one can use a similar procedure
to construct $\mathcal{O}_n \to R_n$ and then one can
show that $\mathcal{O} \to \mathcal{O}_n \to R_n$ factors
through an isomorphism $R \to R_n$, or (2) one can use
Divisors, Lemma \ref{divisors-lemma-characterize-affine-blowup}
to show that $\mathcal{O}_n$ is a localization of a repeated
affine blowup algebra to explicitly construct a map $\mathcal{O}_n \to R$.
Having said this it is clear that our sequence of blowups
comes from the nonsingular arc $a : T = \Spec(R) \to X$.
\end{proof}

\noindent
The following lemma is a kind of N\'eron desingularization lemma.

\begin{lemma}
\label{lemma-sequence-blowups-along-arc-becomes-nonsingular}
Let $(A, \mathfrak m, \kappa)$ be a Noetherian local domain of
dimension $2$. Let $A \to R$ be a surjection onto a
complete discrete valuation ring.
This defines a nonsingular arc $a : T = \Spec(R) \to \Spec(A)$. Let
$$
\Spec(A) = X_0 \leftarrow X_1 \leftarrow X_2 \leftarrow X_3 \leftarrow \ldots
$$
be the sequence of blowing ups constructed from $a$.
If $A_\mathfrak p$ is a regular local ring where
$\mathfrak p = \Ker(A \to R)$, then
for some $i$ the scheme $X_i$ is regular at $x_i$.
\end{lemma}

\begin{proof}
Let $x_1 \in \mathfrak m$ map to a uniformizer of $R$.
Observe that $\kappa(\mathfrak p) = K$ is the
fraction field of $R$. Write $\mathfrak p = (x_2, \ldots, x_r)$
with $r$ minimal. If $r = 2$, then $\mathfrak m = (x_1, x_2)$
and $A$ is regular and the lemma is true. Assume $r > 2$.
After renumbering if necessary,
we may assume that $x_2$ maps to a uniformizer of $A_\mathfrak p$.
Then $\mathfrak p/\mathfrak p^2 + (x_2)$ is annihilated by a power
of $x_1$. For $i > 2$ we can find $n_i \geq 0$ and $a_i \in A$
such that
$$
x_1^{n_i} x_i - a_i x_2 = \sum\nolimits_{2 \leq j \leq k} a_{jk} x_jx_k
$$
for some $a_{jk} \in A$. If $n_i = 0$ for some $i$, then we can remove
$x_i$ from the list of generators of $\mathfrak p$ and we win by
induction on $r$. If for some $i$ the element $a_i$ is a unit, then
we can remove $x_2$ from the list of generators of $\mathfrak p$
and we win in the same manner. Thus either
$a_i \in \mathfrak p$ or $a_i = u_i x_1^{m_1} \bmod \mathfrak p$
for some $m_1 > 0$ and unit $u_i \in A$. Thus we have either
$$
x_1^{n_i} x_i = \sum\nolimits_{2 \leq j \leq k} a_{jk} x_jx_k
\quad\text{or}\quad
x_1^{n_i} x_i - u_i x_1^{m_i} x_2 =
\sum\nolimits_{2 \leq j \leq k} a_{jk} x_jx_k
$$
We will prove that after blowing up the integers $n_i$, $m_i$
decrease which will finish the proof.

\medskip\noindent
Let us see what happens with these equations on the affine blowup
algebra $A' = A[\mathfrak m/x_1]$. As $\mathfrak m = (x_1, \ldots, x_r)$
we see that $A'$ is generated over $R$ by $y_i = x_i/x_1$ for $i \geq 2$.
Clearly $A \to R$ extends to $A' \to R$ with kernel
$(y_2, \ldots, y_r)$. Then we see that either
$$
x_1^{n_i - 1} y_i = \sum\nolimits_{2 \leq j \leq k} a_{jk} y_jy_k
\quad\text{or}\quad
x_1^{n_i - 1} y_i - u_i x_1^{m_1 - 1} y_2 =
\sum\nolimits_{2 \leq j \leq k} a_{jk} y_jy_k
$$
and the proof is complete.
\end{proof}




\section{Base change to the completion}
\label{section-aux}

\noindent
The following simple lemma will turn out to be a useful tool in what follows.

\begin{lemma}
\label{lemma-iso-completions}
Let $(A, \mathfrak m, \kappa)$ be a local ring with finitely generated
maximal ideal $\mathfrak m$. Let $X$ be a scheme over $A$.
Let $Y = X \times_{\Spec(A)} \Spec(A^\wedge)$ where
$A^\wedge$ is the $\mathfrak m$-adic completion of $A$.
For a point $q \in Y$ with image $p \in X$ lying
over the closed point of $\Spec(A)$ the
local ring map $\mathcal{O}_{X, p} \to \mathcal{O}_{Y, q}$
induces an isomorphism on completions.
\end{lemma}

\begin{proof}
We may assume $X$ is affine. Then we may write $X = \Spec(B)$.
Let $\mathfrak q \subset B' = B \otimes_A A^\wedge$ be the
prime corresponding to $q$ and let $\mathfrak p \subset B$
be the prime ideal corresponding to $p$.
By Algebra, Lemma \ref{algebra-lemma-hathat-finitely-generated}
we have
$$
B'/(\mathfrak m^\wedge)^n B' =
A^\wedge/(\mathfrak m^\wedge)^n \otimes_A B =
A/\mathfrak m^n \otimes_A B = B/\mathfrak m^n B
$$
for all $n$. Since $\mathfrak m B \subset \mathfrak p$ and
$\mathfrak m^\wedge B' \subset \mathfrak q$ we see that
$B/\mathfrak p^n$ and $B'/\mathfrak q^n$ are both
quotients of the ring displayed above by the $n$th power
of the same prime ideal. The lemma follows.
\end{proof}

\begin{lemma}
\label{lemma-port-regularity-to-completion}
Let $(A, \mathfrak m, \kappa)$ be a Noetherian local ring.
Let $X \to \Spec(A)$ be a morphism which is locally of finite type.
Set $Y = X \times_{\Spec(A)} \Spec(A^\wedge)$. Let $y \in Y$ with
image $x \in X$. Then
\begin{enumerate}
\item if $\mathcal{O}_{Y, y}$ is regular, then $\mathcal{O}_{X, x}$
is regular,
\item if $y$ is in the closed fibre, then $\mathcal{O}_{Y, y}$ is regular
$\Leftrightarrow \mathcal{O}_{X, x}$ is regular, and
\item If $X$ is proper over $A$, then $X$ is regular
if and only if $Y$ is regular.
\end{enumerate}
\end{lemma}

\begin{proof}
Since $A \to A^\wedge$ is faithfully flat
(Algebra, Lemma \ref{algebra-lemma-completion-faithfully-flat}),
we see that $Y \to X$ is flat. Hence (1) by
Algebra, Lemma \ref{algebra-lemma-descent-regular}.
Lemma \ref{lemma-iso-completions} shows the morphism $Y \to X$
induces an isomorphism on complete local rings at points
of the special fibres. Thus (2) by
More on Algebra, Lemma \ref{more-algebra-lemma-completion-regular}.
If $X$ is proper over $A$, then $Y$ is proper over $A^\wedge$
(Morphisms, Lemma \ref{morphisms-lemma-base-change-proper})
and we see every closed point of $X$ and $Y$ lies in the closed fibre.
Thus we see that $Y$ is a regular scheme if and only if $X$ is so by
Properties, Lemma \ref{properties-lemma-characterize-regular}.
\end{proof}

\begin{lemma}
\label{lemma-descend-admissible-blowup}
Let $(A, \mathfrak m)$ be a Noetherian local ring with completion $A^\wedge$.
Let $U \subset \Spec(A)$ and $U^\wedge \subset \Spec(A^\wedge)$ be the
punctured spectra. If $Y \to \Spec(A^\wedge)$ is a $U^\wedge$-admissible
blowup, then there exists a $U$-admissible blowup $X \to \Spec(A)$
such that $Y = X \times_{\Spec(A)} \Spec(A^\wedge)$.
\end{lemma}

\begin{proof}
By definition there exists an ideal $J \subset A^\wedge$ such that
$V(J) = \{\mathfrak m A^\wedge\}$ and such that $Y$ is the blowup
of $S^\wedge$ in the closed subscheme defined by $J$, see
Divisors, Definition \ref{divisors-definition-admissible-blowup}.
Since $A^\wedge$ is Noetherian this implies
$\mathfrak m^n A^\wedge \subset J$ for some $n$.
Since $A^\wedge/\mathfrak m^n A^\wedge = A/\mathfrak m^n$
we find an ideal $\mathfrak m^n \subset I \subset A$
such that $J = I A^\wedge$. Let $X \to S$ be the blowup in $I$.
Since $A \to A^\wedge$ is flat
we conclude that the base change of $X$ is $Y$ by
Divisors, Lemma \ref{divisors-lemma-flat-base-change-blowing-up}.
\end{proof}

\begin{lemma}
\label{lemma-blowup-still-good}
Let $(A, \mathfrak m, \kappa)$ be a Nagata local normal domain of
dimension $2$. Assume $A$ defines a rational singularity and that
the completion $A^\wedge$ of $A$ is normal. Then
\begin{enumerate}
\item $A^\wedge$ defines a rational singularity, and
\item if $X \to \Spec(A)$ is the blowing up in $\mathfrak m$, then
for a closed point $x \in X$ the completion $\mathcal{O}_{X, x}$ is normal.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $Y \to \Spec(A^\wedge)$ be a modification with $Y$ normal.
We have to show that $H^1(Y, \mathcal{O}_Y) = 0$. By Varieties, Lemma
\ref{varieties-lemma-modification-normal-iso-over-codimension-1}
$Y \to \Spec(A^\wedge)$ is an isomorphism over the punctured
spectrum $U^\wedge = \Spec(A^\wedge) \setminus \{\mathfrak m^\wedge\}$.
By Lemma \ref{lemma-dominate-by-scheme-modification}
there exists a $U^\wedge$-admissible blowup $Y' \to \Spec(A^\wedge)$
dominating $Y$. By Lemma \ref{lemma-descend-admissible-blowup}
we find there exists a $U$-admissible blowup $X \to \Spec(A)$
whose base change to $A^\wedge$ dominates $Y$.
Since $A$ is Nagata, we can replace $X$ by its normalization
after which $X \to \Spec(A)$ is a normal modification (but
possibly no longer a $U$-admissible blowup).
Then $H^1(X, \mathcal{O}_X) = 0$ as $A$ defines a rational
singularity. It follows that
$H^1(X \times_{\Spec(A)} \Spec(A^\wedge),
\mathcal{O}_{X \times_{\Spec(A)} \Spec(A^\wedge)}) = 0$
by flat base change (Cohomology of Schemes, Lemma
\ref{coherent-lemma-flat-base-change-cohomology}
and flatness of $A \to A^\wedge$ by
Algebra, Lemma \ref{algebra-lemma-completion-flat}).
We find that $H^1(Y, \mathcal{O}_Y) = 0$ by
Lemma \ref{lemma-exact-sequence}.

\medskip\noindent
Finally, let $X \to \Spec(A)$ be the blowing up of $\Spec(A)$
in $\mathfrak m$. Then $Y = X \times_{\Spec(A)} \Spec(A^\wedge)$
is the blowing up of $\Spec(A^\wedge)$ in $\mathfrak m^\wedge$.
By Lemma \ref{lemma-blow-up-normal-rational} we see that both $Y$
and $X$ are normal. On the other hand, $A^\wedge$ is excellent
(More on Algebra, Proposition
\ref{more-algebra-proposition-ubiquity-excellent})
hence every affine open in $Y$ is the spectrum of an
excellent normal domain
(More on Algebra, Lemma \ref{more-algebra-lemma-finite-type-over-excellent}).
Thus for $y \in Y$ the ring map
$\mathcal{O}_{Y, y} \to \mathcal{O}_{Y, y}^\wedge$
is regular and by
More on Algebra, Lemma \ref{more-algebra-lemma-normal-goes-up}
we find that $\mathcal{O}_{Y, y}^\wedge$ is normal.
If $x \in X$ is a closed point of the special fibre,
then there is a unique closed point $y \in Y$ lying over $x$.
Since $\mathcal{O}_{X, x} \to \mathcal{O}_{Y, y}$ induces
an isomorphism on completions (Lemma \ref{lemma-iso-completions})
we conclude.
\end{proof}

\begin{lemma}
\label{lemma-formally-unramified}
Let $(A, \mathfrak m)$ be a local Noetherian ring. Let
$X$ be a scheme over $A$. Assume
\begin{enumerate}
\item $A$ is analytically unramified
(Algebra, Definition \ref{algebra-definition-analytically-unramified}),
\item $X$ is locally of finite type over $A$, and
\item $X \to \Spec(A)$ is \'etale at the generic points of irreducible
components of $X$.
\end{enumerate}
Then the normalization of $X$ is finite over $X$.
\end{lemma}

\begin{proof}
Since $A$ is analytically unramified it is reduced
by Algebra, Lemma \ref{algebra-lemma-analytically-unramified-easy}.
Since the normalization of $X$ depends only on the reduction
of $X$, we may replace $X$ by its reduction $X_{red}$; note
that $X_{red} \to X$ is an isomorphism over the open $U$ where
$X \to \Spec(A)$ is \'etale because $U$ is reduced
(Descent, Lemma \ref{descent-lemma-reduced-local-smooth})
hence condition (3) remains true after this replacement.
In addition we may and do assume that $X = \Spec(B)$ is affine.

\medskip\noindent
The map
$$
K = \prod\nolimits_{\mathfrak p \subset A\text{ minimal}} \kappa(\mathfrak p)
\longrightarrow
K^\wedge = \prod\nolimits_{\mathfrak p^\wedge \subset A^\wedge\text{ minimal}}
\kappa(\mathfrak p^\wedge)
$$
is injective because $A \to A^\wedge$ is faithfully flat
(Algebra, Lemma \ref{algebra-lemma-completion-faithfully-flat})
hence induces a surjective map between sets of minimal primes
(by going down for flat ring maps, see
Algebra, Section \ref{algebra-section-going-up}).
Both sides are finite products of fields as our rings are Noetherian.
Let $L = \prod_{\mathfrak q \subset B\text{ minimal}} \kappa(\mathfrak q)$.
Our assumption (3) implies that $L = B \otimes_A K$ and that
$K \to L$ is a finite \'etale ring map (this is true
because $A \to B$ is generically finite, for example use
Algebra, Lemma \ref{algebra-lemma-generically-finite}
or the more detailed results in Morphisms, Section
\ref{morphisms-section-generically-finite}).
Since $B$ is reduced we see that $B \subset L$.
This implies that
$$
C = B \otimes_A A^\wedge \subset
L \otimes_A A^\wedge = L \otimes_K K^\wedge = M
$$
Then $M$ is the total ring of fractions of $C$ and
is a finite product of fields as a finite separable
algebra over $K^\wedge$. It follows that $C$ is reduced
and that its normalization $C'$ is the integral closure of
$C$ in $M$. The normalization $B'$ of $B$ is the integral
closure of $B$ in $L$. By flatness of $A \to A^\wedge$
we obtain an injective map $B' \otimes_A A^\wedge \to M$ whose
image is contained in $C'$. Picture
$$
B' \otimes_A A^\wedge \longrightarrow C'
$$
As $A^\wedge$ is Nagata (by
Algebra, Lemma \ref{algebra-lemma-Noetherian-complete-local-Nagata}),
we see that $C'$ is finite over
$C = B \otimes_A A^\wedge$ (see
Algebra, Lemmas
\ref{algebra-lemma-Noetherian-complete-local-Nagata} and
\ref{algebra-lemma-nagata-in-reduced-finite-type-finite-integral-closure}).
As $C$ is Noetherian, we conclude that
$B' \otimes_A A^\wedge$ is finite over $C = B \otimes_A A^\wedge$.
Therefore by faithfully flat descent
(Algebra, Lemma \ref{algebra-lemma-descend-properties-modules})
we see that $B'$ is finite over $B$ which is what we had to show.
\end{proof}

\begin{lemma}
\label{lemma-normalization-completion}
Let $(A, \mathfrak m, \kappa)$ be a Noetherian local ring.
Let $X \to \Spec(A)$ be a morphism which is locally of finite type.
Set $Y = X \times_{\Spec(A)} \Spec(A^\wedge)$.
If the complement of the special fibre in $Y$ is normal, then
the normalization $X^\nu \to X$ is finite and the base change
of $X^\nu$ to $\Spec(A^\wedge)$ recovers the normalization of $Y$.
\end{lemma}

\begin{proof}
There is an immediate reduction to the case where $X = \Spec(B)$
is affine with $B$ a finite type $A$-algebra. Set $C = B \otimes_A A^\wedge$
so that $Y = \Spec(C)$. Since
$A \to A^\wedge$ is faithfully flat, for any prime $\mathfrak q \subset B$
there exists a prime $\mathfrak r \subset C$ lying over $\mathfrak q$.
Then $B_\mathfrak q \to C_\mathfrak r$ is faithfully flat. Hence if
$\mathfrak q$ does not lie over $\mathfrak m$, then $C_\mathfrak r$
is normal by assumption on $Y$ and we conclude that $B_\mathfrak q$
is normal by Algebra, Lemma \ref{algebra-lemma-descent-normal}.
In this way we see that $X$ is normal away from the special fibre.

\medskip\noindent
Recall that the complete Noetherian local ring $A^\wedge$ is Nagata
(Algebra, Lemma \ref{algebra-lemma-Noetherian-complete-local-Nagata}).
Hence the normalization $Y^\nu \to Y$ is finite
(Morphisms, Lemma \ref{morphisms-lemma-nagata-normalization})
and an isomorphism away from the special fibre. Say $Y^\nu = \Spec(C')$.
Then $C \to C'$ is finite and an isomorphism away from $V(\mathfrak m C)$.
Since $B \to C$ is flat and induces an isomorphism
$B/\mathfrak m B \to C/\mathfrak m C$ there exists a finite
ring map $B \to B'$ whose base change to $C$ recovers $C \to C'$.
See More on Algebra, Lemma
\ref{more-algebra-lemma-application-formal-glueing} and
Remark \ref{more-algebra-remark-formal-glueing-algebras}.
Thus we find a finite morphism $X' \to X$ which is an isomorphism
away from the special fibre and whose base change recovers $Y^\nu \to Y$.
By the discussion in the first paragraph we see that $X'$ is normal at
points not on the special fibre. For a point $x \in X'$ on the special
fibre we have a corresponding point $y \in Y^\nu$ and a flat map
$\mathcal{O}_{X', x} \to \mathcal{O}_{Y^\nu, y}$.
Since $\mathcal{O}_{Y^\nu, y}$ is normal, so is $\mathcal{O}_{X', x}$, see
Algebra, Lemma \ref{algebra-lemma-descent-normal}.
Thus $X'$ is normal and it follows that it is the normalization of $X$.
\end{proof}

\begin{lemma}
\label{lemma-normalized-blowup-completion}
Let $(A, \mathfrak m, \kappa)$ be a Noetherian local domain whose completion
$A^\wedge$ is normal. Then given any sequence
$$
Y_n \to Y_{n - 1} \to \ldots \to Y_1 \to \Spec(A^\wedge)
$$
of normalized blowups, there exists a sequence of (proper) normalized blowups
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to \Spec(A)
$$
whose base change to $A^\wedge$ recovers the given sequence.
\end{lemma}

\begin{proof}
Given the sequence $Y_n \to \ldots \to Y_1 \to Y_0 = \Spec(A^\wedge)$ we
inductively construct $X_n \to \ldots \to X_1 \to X_0 = \Spec(A)$.
The base case is $i = 0$. Given $X_i$ whose base change is $Y_i$,
let $Y'_i \to Y_i$ be the blowing up in the closed point $y_i \in Y_i$
such that $Y_{i + 1}$ is the normalization of $Y_i$.
Since the closed fibres of $Y_i$ and $X_i$ are isomorphic, the point
$y_i$ corresponds to a closed point $x_i$ on the special fibre of $X_i$.
Let $X'_i \to X_i$ be the blowup of $X_i$ in $x_i$. Then the base change
of $X'_i$ to $\Spec(A^\wedge)$ is isomorphic to $Y'_i$. 
By Lemma \ref{lemma-normalization-completion}
the normalization $X_{i + 1} \to X'_i$ is finite and its base change
to $\Spec(A^\wedge)$ is isomorphic to $Y_{i + 1}$.
\end{proof}














\section{Rational double points}
\label{section-rational-double-points}

\noindent
In Section \ref{section-rational-singularities}
we argued that resolution of $2$-dimensional
rational singularities reduces to the Gorenstein case.
A Gorenstein rational surface singularity is a rational double point.
We will resolve them by explicit computations.

\medskip\noindent
According to the discussion in Examples, Section \ref{examples-section-bad}
there exists a normal Noetherian local domain $A$ whose completion
is isomorphic to $\mathbf{C}[[x, y, z]]/(z^2)$. In this case one could
say that $A$ has a rational double point singularity, but on the other
hand, $\Spec(A)$ does not have a resolution of singularities.
This kind of behaviour cannot occur if $A$ is a Nagata ring, see
Algebra, Lemma \ref{algebra-lemma-local-nagata-domain-analytically-unramified}.

\medskip\noindent
However, it gets worse as there exists a local normal Nagata domain $A$
whose completion is $\mathbf{C}[[x, y, z]]/(yz)$ and another whose
completion is $\mathbf{C}[[x, y, z]]/(y^2 - z^3)$. This is Example 2.5 of
\cite{Nishimura-few}. This is why we need to assume the completion of
our ring is normal in this section.

\begin{situation}
\label{situation-rational-double-point}
Here $(A, \mathfrak m, \kappa)$ be a Nagata local normal domain of
dimension $2$ which defines a rational singularity, whose completion
is normal, and which is Gorenstein. We assume $A$ is not regular.
\end{situation}

\noindent
The arguments in this section will show that repeatedly blowing
up singular points resolves $\Spec(A)$ in this situation. We will
need the following lemma in the course of the proof.

\begin{lemma}
\label{lemma-issquare}
Let $\kappa$ be a field. Let $I \subset \kappa[x, y]$ be an ideal. Let
$$
a + b x + c y + d x^2 + exy + f y^2 \in I^2
$$
for some $a, b, c, d, e, f \in k$ not all zero. If the colength
of $I$ in $\kappa[x, y]$ is $> 1$, then
$a + b x + c y + d x^2 + exy + f y^2 = j(g + hx + iy)^2$
for some $j, g, h, i \in \kappa$.
\end{lemma}

\begin{proof}
Consider the partial derivatives $b + 2dx + ey$ and
$c + ex + 2fy$. By the Leibniz rules these are contained in $I$.
If one of these is nonzero, then after a linear change of coordinates,
i.e., of the form $x \mapsto \alpha + \beta x + \gamma y$ and
$y \mapsto \delta + \epsilon x + \zeta y$, we may assume
that $x \in I$. Then we see that $I = (x)$ or $I = (x, F)$ with
$F$ a monic polynomial of degree $\geq 2$ in $y$.
In the first case the statement is clear. In the second case
observe that we can write any element in $I^2$ in the form
$$
A(x, y) x^2 + B(y) x F + C(y) F^2
$$
for some $A(x, y) \in \kappa[x, y]$ and $B, C \in \kappa[y]$.
Thus
$$
a + b x + c y + d x^2 + exy + f y^2 = A(x, y) x^2 + B(y) x F + C(y) F^2
$$
and by degree reasons we see that $B = C = 0$ and $A$ is a constant.

\medskip\noindent
To finish the proof we need to deal with the case that both
partial derivatives are zero. This can only happen in characteristic $2$
and then we get
$$
a + d x^2 + f y^2 \in I^2
$$
We may assume $f$ is nonzero (if not, then switch the roles of $x$ and $y$).
After dividing by $f$ we obtain the case where the characteristic of
$\kappa$ is $2$ and
$$
a + d x^2 + y^2 \in I^2
$$
If $a$ and $d$ are squares in $\kappa$, then we are done. If not,
then there exists a derivation $\theta : \kappa \to \kappa$ with
$\theta(a) \not = 0$ or $\theta(d) \not = 0$, see
Algebra, Lemma \ref{algebra-lemma-derivative-zero-pth-power}.
We can extend this to a derivation of $\kappa[x, y]$ by setting
$\theta(x) = \theta(y) = 0$. Then we find that
$$
\theta(a) + \theta(d) x^2 \in I
$$
The case $\theta(d) = 0$ is absurd. Thus we may assume
that $\alpha + x^2 \in I$ for some $\alpha \in \kappa$.
Combining with the above we find that $a + \alpha d + y^2 \in I$.
Hence
$$
J = (\alpha + x^2, a + \alpha d + y^2) \subset I
$$
with codimension at most $2$. Observe that
$J/J^2$ is free over $\kappa[x, y]/J$ with basis
$\alpha + x^2$ and $a + \alpha d + y^2$.
Thus $a + d x^2 + y^2 =
1 \cdot (a + \alpha d + y^2) + d \cdot (\alpha + x^2) \in I^2$
implies that the inclusion $J \subset I$ is strict.
Thus we find a nonzero element of the form $g + hx + iy + jxy$ in $I$.
If $j = 0$, then $I$ contains a linear form and we can
conclude as in the first paragraph. Thus $j \not = 0$
and $\dim_\kappa(I/J) = 1$ (otherwise we could find
an element as above in $I$ with $j = 0$).
We conclude that $I$ has the form
$(\alpha + x^2, \beta + y^2, g + hx + iy + jxy)$
with $j \not = 0$ and has colength $3$.
In this case $a + dx^2 + y^2 \in I^2$ is impossible.
This can be shown by a direct computation, but we prefer to argue
as follows. Namely, to prove this statement we may assume that
$\kappa$ is algebraically closed. Then we can do a coordinate
change $x \mapsto \sqrt{\alpha} + x$ and $y \mapsto \sqrt{\beta} + y$
and assume that $I = (x^2, y^2, g' + h'x + i'y + jxy)$ with the same $j$.
Then $g' = h' = i' = 0$ otherwise the colength of $I$ is not $3$.
Thus we get $I = (x^2, y^2, xy)$ and the result is clear.
\end{proof}

\noindent
Let $(A, \mathfrak m, \kappa)$ be as in
Situation \ref{situation-rational-double-point}.
Let $X \to \Spec(A)$ be the blowing up of $\mathfrak m$ in $\Spec(A)$.
By Lemma \ref{lemma-blow-up-normal-rational} we see that $X$ is normal.
All singularities of $X$ are rational singularities
by Lemma \ref{lemma-rational-propagates}.
Since $\omega_A = A$ we see from Lemma \ref{lemma-dualizing-blow-up-rational}
that $\omega_X \cong \mathcal{O}_X$ (see discussion in
Remark \ref{remark-dualizing-setup} for conventions).
Thus all singularities of $X$ are Gorenstein.
Moreover, the local rings of $X$ at closed point have
normal completions by Lemma \ref{lemma-blowup-still-good}.
In other words, by blowing up $\Spec(A)$ we obtain a normal
surface $X$ whose singular points are as in
Situation \ref{situation-rational-double-point}.
We will use this below without further mention.
(Note: we will see in the course of the discussion below
that there are finitely many of these singular points.)

\medskip\noindent
Let $E \subset X$ be the exceptional divisor. We have
$\omega_E = \mathcal{O}_E(-1)$ by Lemma \ref{lemma-dualizing-blow-up-rational}.
By Lemma \ref{lemma-cohomology-blow-up-rational} we have
$\kappa = H^0(E, \mathcal{O}_E)$.
Thus $E$ is a Gorenstein curve and by Riemann-Roch as discussed in
Algebraic Curves, Section \ref{curves-section-Riemann-Roch}
we have
$$
\chi(E, \mathcal{O}_E) = 1 - g = -(1/2) \deg(\omega_E) =
(1/2)\deg(\mathcal{O}_E(1))
$$
where $g = \dim_\kappa H^1(E, \mathcal{O}_E) \geq 0$.
Since $\deg(\mathcal{O}_E(1))$ is positive
by Varieties, Lemma
\ref{varieties-lemma-ampleness-in-terms-of-degrees-components}
we find that $g = 0$ and $\deg(\mathcal{O}_E(1)) = 2$. It follows that
we have
$$
\dim_\kappa (\mathfrak m^n/\mathfrak m^{n + 1}) = 2n + 1
$$
by Lemma \ref{lemma-cohomology-blow-up-rational} and Riemann-Roch
on $E$.

\medskip\noindent
Choose $x_1, x_2, x_3 \in \mathfrak m$ which map to a basis of
$\mathfrak m/\mathfrak m^2$. Because
$\dim_\kappa(\mathfrak m^2/\mathfrak m^3) = 5$
the images of $x_i x_j$, $i \geq j$ in this $\kappa$-vector space
satisfy a relation. In other words, we can find $a_{ij} \in A$,
$i \geq j$, not all contained in $\mathfrak m$, such that
$$
a_{11} x_1^2 + a_{12} x_1x_2 + a_{13}x_1x_3 + a_{22} x_2^2 +
a_{23} x_2x_3 + a_{33} x_3^2 =
\sum a_{ijk} x_ix_jx_k
$$
for some $a_{ijk} \in A$ where $i \leq j \leq k$. Denote
$a \mapsto \overline{a}$ the map $A \to \kappa$.
The quadratic form
$q = \sum \overline{a}_{ij} t_i t_j \in \kappa[t_1, t_2, t_3]$
is well defined up to multiplication by an element of $\kappa^*$
by our choices. If during the course of our arguments we find
that $\overline{a}_{ij} = 0$ in $\kappa$,
then we can subsume the term $a_{ij} x_i x_j$ in the right
hand side and assume $a_{ij} = 0$; this operation changes the $a_{ijk}$
but not the other $a_{i'j'}$.

\medskip\noindent
The blowing up is covered by $3$ affine charts corresponding to
the ``variables'' $x_1, x_2, x_3$. By symmetry it suffices to study
one of the charts. To do this let
$$
A' = A[\mathfrak m/x_1]
$$
be the affine blowup algebra (as in
Algebra, Section \ref{algebra-section-blow-up}).
Since $x_1, x_2, x_3$ generate $\mathfrak m$ we see that $A'$
is generated by $y_2 = x_2/x_1$ and $y_3 = x_3/x_1$ over $A$.
We will occasionally use $y_1 = 1$ to simplify formulas.
Moreover, looking at our relation above we find that
$$
a_{11} + a_{12} y_2 + a_{13} y_3 + a_{22} y_2^2 +
a_{23} y_2y_3 + a_{33} y_3^2 =
x_1 (\sum a_{ijk} y_iy_jy_k)
$$
in $A'$. Recall that $x_1 \in A'$ defines the exceptional divisor $E$
on our affine open of $X$
which is therefore scheme theoretically given by
$$
\kappa[y_2, y_3]/
(\overline{a}_{11} + \overline{a}_{12} y_2 + \overline{a}_{13} y_3 +
\overline{a}_{22} y_2^2 + \overline{a}_{23} y_2y_3 + \overline{a}_{33} y_3^2)
$$
In other words,
$E \subset \mathbf{P}^2_\kappa = \text{Proj}(\kappa[t_1, t_2, t_3])$ is
the zero scheme of the quadratic form $q$ introduced above.

\medskip\noindent
The quadratic form $q$ is an important invariant of the singularity
defined by $A$. Let us say we are in
{\bf case II} if $q$ is a square of a linear form times
an element of $\kappa^*$ and in {\bf case I} otherwise.
Observe that we are in case II exactly if, after
changing our choice of $x_1, x_2, x_3$, we have
$$
x_3^2 = \sum a_{ijk}x_ix_jx_k
$$
in the local ring $A$.

\medskip\noindent
Let $\mathfrak m' \subset A'$ be a maximal ideal lying over $\mathfrak m$
with residue field $\kappa'$. In other words, $\mathfrak m'$ corresponds
to a closed point $p \in E$ of the exceptional divisor. Recall that the
surjection
$$
\kappa[y_2, y_3] \to \kappa'
$$
has kernel generated by two elements $f_2, f_3 \in \kappa[y_2, y_3]$
(see for example Algebra, Example \ref{algebra-example-spec-kxy}
or the proof of
Algebra, Lemma \ref{algebra-lemma-dim-affine-space}).
Let $z_2, z_3 \in A'$ map to $f_2, f_3$ in $\kappa[y_2, y_3]$.
Then we see that $\mathfrak m' = (x_1, z_2, z_3)$ because
$x_2$ and $x_3$ become divisible by $x_1$ in $A'$.

\medskip\noindent
{\bf Claim.} If $X$ is singular at $p$, then $\kappa' = \kappa$ or we are
in case II. Namely, if $A'_{\mathfrak m'}$
is singular, then $\dim_{\kappa'} \mathfrak m'/(\mathfrak m')^2 = 3$
which implies that
$\dim_{\kappa'} \overline{\mathfrak m}'/(\overline{\mathfrak m}')^2 = 2$
where $\overline{m}'$ is the maximal ideal of
$\mathcal{O}_{E, p} = \mathcal{O}_{X, p}/x_1\mathcal{O}_{X, p}$.
This implies that
$$
q(1, y_2, y_3) =
\overline{a}_{11} + \overline{a}_{12} y_2 + \overline{a}_{13} y_3 +
\overline{a}_{22} y_2^2 + \overline{a}_{23} y_2y_3 + \overline{a}_{33} y_3^2
\in (f_2, f_3)^2
$$
otherwise there would be a relation between the classes of $z_2$
and $z_3$ in $\overline{\mathfrak m}'/(\overline{\mathfrak m}')^2$.
The claim now follows from Lemma \ref{lemma-issquare}.

\medskip\noindent
Resolution in case I. By the claim any
singular point of $X$ is $\kappa$-rational. Pick such a singular point $p$.
We may choose our $x_1, x_2, x_3 \in \mathfrak m$ such that $p$
lies on the chart described above and has coordinates $y_2 = y_3 = 0$.
Since it is a singular point arguing as in the proof of the claim
we find that $q(1, y_2, y_3) \in (y_2, y_3)^2$.
Thus we can choose $a_{11} = a_{12} = a_{13} = 0$ and
$q(t_1, t_2, t_3) = q(t_2, t_3)$. It follows that
$$
E = V(q) \subset \mathbf{P}^1_\kappa
$$
either is the union of two distinct lines meeting at $p$
or is a degree $2$ curve with a unique $\kappa$-rational point
(small detail omitted; use that $q$ is not a square of a linear
form up to a scalar).
In both cases we conclude that $X$ has a unique singular point $p$
which is $\kappa$-rational. We need a bit more information in this
case. First, looking at higher terms in the expression above, we
find that $\overline{a}_{111} = 0$ because $p$ is singular.
Then we can write $a_{111} = b_{111} x_1 \bmod (x_2, x_3)$
for some $b_{111} \in A$. Then
the quadratic form at $p$ for the generators
$x_1, y_2, y_3$ of $\mathfrak m'$ is
$$
q' =
\overline{b}_{111} t_1^2 +
\overline{a}_{112} t_1 t_2 + \overline{a}_{113} t_1 t_3 +
\overline{a}_{22} t_2^2 +
\overline{a}_{23} t_2 t_3 +
\overline{a}_{33} t_3^2
$$
We see that $E' = V(q')$ intersects the line $t_1 = 0$ in either
two points or one point of degree $2$. We conclude that $p$
lies in case I.

\medskip\noindent
Suppose that the blowing up $X' \to X$ of $X$ at $p$ again has a
singular point $p'$. Then we see that $p'$ is a $\kappa$-rational
point and we can blow up to get $X'' \to X'$. If this process
does not stop we get a sequence of blowings up
$$
\Spec(A) \leftarrow X \leftarrow X' \leftarrow X'' \leftarrow \ldots
$$
We want to show that
Lemma \ref{lemma-sequence-blowups}
applies to this situation. To do this we have to say something
about the choice of the element $x_1$ of $\mathfrak m$.
Suppose that $A$ is in case I and that $X$ has a singular point.
Then we will say that $x_1 \in \mathfrak m$ is a {\it good coordinate}
if for any (equivalently some) choice of $x_2, x_3$ the quadratic
form $q(t_1, t_2, t_3)$ has the property that $q(0, t_2, t_3)$
is not a scalar times a square. We have seen above that a good
coordinate exists. If $x_1$ is a good coordinate, then the
singular point $p \in E$ of $X$ does not lie on the hypersurface
$t_1 = 0$ because either this does not have a rational point or
if it does, then it is not singular on $X$. Observe that this
is equivalent to the
statement that the image of $x_1$ in $\mathcal{O}_{X, p}$ cuts
out the exceptional divisor $E$. Now the computations above show
that if $x_1$ is a good coordinate for $A$, then
$x_1 \in \mathfrak m'\mathcal{O}_{X, p}$ is a good coordinate
for $p$. This of course uses that the notion of good coordinate
does not depend on the choice of $x_2$, $x_3$ used to do the
computation. Hence $x_1$ maps to a good coordinate at
$p'$, $p''$, etc. Thus
Lemma \ref{lemma-sequence-blowups}
applies and our sequence of blowing
ups comes from a nonsingular arc $A \to R$.
Then the map $A^\wedge \to R$ is a surjection.
Since the completion of $A$ is normal, we conclude by
Lemma \ref{lemma-sequence-blowups-along-arc-becomes-nonsingular}
that after a finite number of blowups
$$
\Spec(A^\wedge) \leftarrow X^\wedge \leftarrow (X')^\wedge \leftarrow \ldots
$$
the resulting scheme $(X^{(n)})^\wedge$ is regular. Since
$(X^{(n)})^\wedge \to X^{(n)}$ induces isomorphisms on complete
local rings (Lemma \ref{lemma-iso-completions}) we conclude
that the same is true for $X^{(n)}$.

\medskip\noindent
Resolution in case II. Here we have
$$
x_3^2 = \sum a_{ijk}x_ix_jx_k
$$
in $A$ for some choice of generators $x_1, x_2, x_3$ of $\mathfrak m$.
Then $q = t_3^2$ and $E = 2C$ where $C$ is a line.
Recall that in $A'$ we get
$$
y_3^2 = x_1(\sum a_{ijk} y_iy_jy_k)
$$
Since we know that $X$ is normal, we get a discrete valuation
ring $\mathcal{O}_{X, \xi}$ at the generic point $\xi$ of $C$.
The element $y_3 \in A'$ maps to a uniformizer of $\mathcal{O}_{X, \xi}$.
Since $x_1$ scheme theoretically cuts out $E$
which is $C$ with multiplicity $2$, we see that
$x_1$ is a unit times $y_3^2$ in $\mathcal{O}_{X, \xi}$. Looking
at our equality above we conclude that
$$
h(y_2) = \overline{a}_{111} + \overline{a}_{112} y_2 +
\overline{a}_{122} y_2^2 +
\overline{a}_{222} y_2^3
$$
must be nonzero in the residue field of $\xi$.
Now, suppose that $p \in C$ defines a singular point.
Then $y_3$ is zero at $p$ and $p$ must correspond to a
zero of $h$ by the reasoning used in proving the claim above.
If $h$ does not have a double zero at $p$, then the quadratic
form $q'$ at $p$ is not a square and we conclude that $p$
falls in case I which we have treated above\footnote{The maximal
ideal at $p$ in $A'$ is generated by $y_3, x_1$ and a third element
$g$ whose image in $\kappa[y_2]$ is the prime divisor of $h$
corresponding to $p$. If this prime divisor doesn't divide $h$
twice, then we see that the quadratic form at $p$ looks like
$$
y_3^2 - x_1((something)x_1 + (something)y_3 + (unit)g)
$$
and this can never be a square in $\kappa[y_3, x_1, g]$.}.
Since the degree of $h$ is $3$ we
get at most one singular point $p \in C$ falling into case II
which is moreover $\kappa$-rational. After changing our
choice of $x_1, x_2, x_3$ we may assume this is the point
$y_2 = y_3 = 0$.
Then $h = \overline{a}_{122} y_2^2 + \overline{a}_{222} y_2^3$.
Moreover, it still has to be the case that
$\overline{a}_{113} = 0$ for the quadratic form $q'$ to have
the right shape.
Thus the local ring $\mathcal{O}_{X, p}$ defines a singularity
as in the next paragraph.

\medskip\noindent
The final case we treat is the case where we can choose our generators
$x_1, x_2, x_3$ of $\mathfrak m$ such that
$$
x_3^2 + x_1(a x_2^2 + b x_2x_3 + c x_3^2) \in \mathfrak m^4
$$
for some $a, b, c \in A$. This is a subclass of case II. If
$\overline{a} = 0$, then we can write
$a = a_1 x_1 + a_2 x_2 + a_3 x_3$ and we get after blowing up
$$
y_3^2 + x_1(a_1 x_1 y_2^2 + a_2 x_1 y_2^3 + a_3 x_1 y_2^2 y_3 +
b y_2 y_3 + c y_3^2) = x_1^2 (\sum a_{ijkl}y_iy_jy_ky_l)
$$
This means that $X$ is not normal\footnote{Namely, the
equation shows that you get something singular along the
$1$-dimensional locus $x_1 = y_3 = 0$ which cannot happen
for a normal surface.} a contradiction. By the result
of the previous paragraph, if the blowup $X$
has a singular point $p$ which falls in case II, then
there is only one and it is $\kappa$-rational.
Computing the affine blowup algebras
$A[\frac{\mathfrak m}{x_2}]$ and $A[\frac{\mathfrak m}{x_3}]$
the reader easily sees that $p$ cannot be contained
the corresponding opens of $X$. Thus $p$ is in the spectrum
of $A[\frac{\mathfrak m}{x_1}]$. Doing the blowing up as before we see that
$p$ must be the point with coordinates $y_2 = y_3 = 0$ and the new
equation looks like
$$
y_3^2 + x_1(a y_2^2 + b y_2 y_3 + c y_3^2) \in (\mathfrak m')^4
$$
which has the same shape as before and has the property
that $x_1$ defines the exceptional divisor. Thus if the process
does not stop we get an infinite sequence of blowups and on
each of these $x_1$ defines the exceptional divisor in the
local ring of the singular point. Thus we can
finish the proof using
Lemmas \ref{lemma-sequence-blowups} and
\ref{lemma-sequence-blowups-along-arc-becomes-nonsingular}
and the same reasoning as before.

\begin{lemma}
\label{lemma-resolve-rational-double-points}
Let $(A, \mathfrak m, \kappa)$ be a local normal Nagata
domain of dimension $2$ which defines a rational singularity,
whose completion is normal, and which is Gorenstein.
Then there exists a finite sequence of blowups in
singular closed points
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to X_0 = \Spec(A)
$$
such that $X_n$ is regular and such that each intervening
schemes $X_i$ is normal with finitely many singular points
of the same type.
\end{lemma}

\begin{proof}
This is exactly what was proved in the discussion above.
\end{proof}




\section{Implied properties}
\label{section-existence-gives}

\noindent
In this section we prove that for a Noetherian integral scheme
the existence of a regular alteration has quite a few consequences.
This section should be skipped by those not interested in
``bad'' Noetherian rings.

\begin{lemma}
\label{lemma-regular-alteration-implies}
Let $Y$ be a Noetherian integral scheme. Assume there exists an alteration
$f : X \to Y$ with $X$ regular. Then the normalization $Y^\nu \to Y$
is finite and $Y$ has a dense open which is regular.
\end{lemma}

\begin{proof}
It suffices to prove this when $Y = \Spec(A)$ where $A$ is a Noetherian domain.
Let $B$ be the integral closure of $A$ in its fraction field.
Set $C = \Gamma(X, \mathcal{O}_X)$. By
Cohomology of Schemes, Lemma
\ref{coherent-lemma-proper-over-affine-cohomology-finite}
we see that $C$ is a finite $A$-module. As $X$ is normal
(Properties, Lemma \ref{properties-lemma-regular-normal})
we see that $C$ is normal domain
(Properties, Lemma \ref{properties-lemma-normal-integral-sections}).
Thus $B \subset C$ and we conclude that $B$ is finite over $A$
as $A$ is Noetherian.

\medskip\noindent
There exists a nonempty open $V \subset Y$ such that $f^{-1}V \to V$
is finite, see Morphisms, Definition \ref{morphisms-definition-alteration}.
After shrinking $V$ we may assume that $f^{-1}V \to V$ is flat
(Morphisms, Proposition \ref{morphisms-proposition-generic-flatness}).
Thus $f^{-1}V \to V$ is faithfully flat. Then $V$ is regular by
Algebra, Lemma \ref{algebra-lemma-descent-regular}.
\end{proof}

\begin{lemma}
\label{lemma-algebra-helper}
Let $(A, \mathfrak m)$ be a local Noetherian ring. Let $B \subset C$
be finite $A$-algebras. Assume that (a) $B$ is a normal ring, and
(b) the $\mathfrak m$-adic completion $C^\wedge$ is a normal ring.
Then $B^\wedge$ is a normal ring.
\end{lemma}

\begin{proof}
Consider the commutative diagram
$$
\xymatrix{
B \ar[r] \ar[d] & C \ar[d] \\
B^\wedge \ar[r] & C^\wedge
}
$$
Recall that $\mathfrak m$-adic completion on the category of
finite $A$-modules is exact because it is given by tensoring with
the flat $A$-algebra $A^\wedge$
(Algebra, Lemma \ref{algebra-lemma-completion-flat}).
We will use Serre's criterion
(Algebra, Lemma \ref{algebra-lemma-criterion-normal})
to prove that the Noetherian ring $B^\wedge$ is normal.
Let $\mathfrak q \subset B^\wedge$ be a prime lying over
$\mathfrak p \subset B$. If $\dim(B_\mathfrak p) \geq 2$, then
$\text{depth}(B_\mathfrak p) \geq 2$ and since
$B_\mathfrak p \to B^\wedge_\mathfrak q$ is flat we find
that $\text{depth}(B^\wedge_\mathfrak q) \geq 2$
(Algebra, Lemma \ref{algebra-lemma-apply-grothendieck}).
If $\dim(B_\mathfrak p) \leq 1$, then $B_\mathfrak p$ is
either a discrete valuation ring or a field.
In that case $C_\mathfrak p$ is faithfully flat over $B_\mathfrak p$
(because it is finite and torsion free).
Hence $B^\wedge_\mathfrak p \to C^\wedge_\mathfrak p$ is
faithfully flat and the same holds after localizing at $\mathfrak q$.
As $C^\wedge$ and hence any localization is $(S_2)$ we conclude that
$B^\wedge_\mathfrak p$ is $(S_2)$ by
Algebra, Lemma \ref{algebra-lemma-descent-Sk}.
All in all we find that
$(S_2)$ holds for $B^\wedge$. To prove that $B^\wedge$ is
$(R_1)$ we only have to consider primes $\mathfrak q \subset B^\wedge$
with $\dim(B^\wedge_\mathfrak q) \leq 1$. Since
$\dim(B^\wedge_\mathfrak q) = \dim(B_\mathfrak p) +
\dim(B^\wedge_\mathfrak q/\mathfrak p B^\wedge_\mathfrak q)$ by
Algebra, Lemma \ref{algebra-lemma-dimension-base-fibre-total}
we find that $\dim(B_\mathfrak p) \leq 1$ and
we see that $B^\wedge_\mathfrak q \to C^\wedge_\mathfrak q$
is faithfully flat as before. We conclude using
Algebra, Lemma \ref{algebra-lemma-descent-Rk}.
\end{proof}

\begin{lemma}
\label{lemma-regular-alteration-implies-local}
Let $(A, \mathfrak m, \kappa)$ be a local Noetherian domain.
Assume there exists an alteration $f : X \to \Spec(A)$
with $X$ regular. Then
\begin{enumerate}
\item there exists a nonzero $f \in A$ such that $A_f$ is regular,
\item the integral closure $B$ of $A$ in its fraction field is finite over $A$,
\item the $\mathfrak m$-adic completion of $B$ is a normal ring, i.e., the
completions of $B$ at its maximal ideals are normal domains, and
\item the generic formal fibre of $A$ is regular.
\end{enumerate}
\end{lemma}

\begin{proof}
Parts (1) and (2) follow from Lemma \ref{lemma-regular-alteration-implies}.
We have to redo part of the proof of that lemma in order to set up notation
for the proof of (3). Set $C = \Gamma(X, \mathcal{O}_X)$. By
Cohomology of Schemes, Lemma
\ref{coherent-lemma-proper-over-affine-cohomology-finite}
we see that $C$ is a finite $A$-module. As $X$ is normal
(Properties, Lemma \ref{properties-lemma-regular-normal})
we see that $C$ is normal domain
(Properties, Lemma \ref{properties-lemma-normal-integral-sections}).
Thus $B \subset C$ and we conclude that $B$ is finite over $A$
as $A$ is Noetherian. By Lemma \ref{lemma-algebra-helper}
in order to prove (3) it suffices to show
that the $\mathfrak m$-adic completion $C^\wedge$ is normal.

\medskip\noindent
By Algebra, Lemma \ref{algebra-lemma-completion-finite-extension}
the completion $C^\wedge$ is the product of the completions of
$C$ at the prime ideals of $C$ lying over $\mathfrak m$.
There are finitely many of these and these are the maximal
ideals $\mathfrak m_1, \ldots, \mathfrak m_r$ of $C$.
(The corresponding result for $B$ explains the final statement of the lemma.)
Thus replacing $A$ by $C_{\mathfrak m_i}$ and $X$ by
$X_i = X \times_{\Spec(C)} \Spec(C_{\mathfrak m_i})$
we reduce to the case discussed in the next paragraph.
(Note that $\Gamma(X_i, \mathcal{O}) = C_{\mathfrak m_i}$ by
Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}.)

\medskip\noindent
Here $A$ is a Noetherian local normal domain and $f : X \to \Spec(A)$ is a
regular alteration with $\Gamma(X, \mathcal{O}_X) = A$.
We have to show that the completion $A^\wedge$
of $A$ is a normal domain. By
Lemma \ref{lemma-port-regularity-to-completion}
$Y = X \times_{\Spec(A)} \Spec(A^\wedge)$ is regular.
Since $\Gamma(Y, \mathcal{O}_Y) = A^\wedge$ by
Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology},
we conclude that $A^\wedge$ is normal as before.
Namely, $Y$ is normal by
Properties, Lemma \ref{properties-lemma-regular-normal}.
It is connected because $\Gamma(Y, \mathcal{O}_Y) = A^\wedge$ is local.
Hence $Y$ is normal and integral (as connected and normal
implies integral for Noetherian schemes). Thus
$\Gamma(Y, \mathcal{O}_Y) = A^\wedge$
is a normal domain by
Properties, Lemma \ref{properties-lemma-normal-integral-sections}.
This proves (3).

\medskip\noindent
Proof of (4). Let $\eta \in \Spec(A)$ denote the generic point
and denote by a subscript $\eta$ the base change to $\eta$.
Since $f$ is an alteration, the scheme $X_\eta$ is finite and
faithfully flat over $\eta$. Since $Y = X \times_{\Spec(A)} \Spec(A^\wedge)$
is regular by Lemma \ref{lemma-port-regularity-to-completion}
we see that $Y_\eta$ is regular (as a limit of opens in $Y$).
Then $Y_\eta \to \Spec(A^\wedge \otimes_A \kappa(\eta))$ is finite
faithfully flat onto the generic formal fibre. We conclude by
Algebra, Lemma \ref{algebra-lemma-descent-regular}.
\end{proof}











\section{Resolution}
\label{section-resolution}



\noindent
Here is a definition.

\begin{definition}
\label{definition-resolution}
Let $Y$ be a Noetherian integral scheme. A {\it resolution of singularities}
of $Y$ is a modification $f : X \to Y$ such that $X$ is regular.
\end{definition}

\noindent
In the case of surfaces we sometimes want a bit more information.

\begin{definition}
\label{definition-resolution-surface}
Let $Y$ be a $2$-dimensional Noetherian integral scheme.
We say $Y$ has a {\it resolution of singularities by normalized blowups}
if there exists a sequence
$$
Y_n \to Y_{n - 1} \to \ldots \to Y_1 \to Y_0 \to Y
$$
where
\begin{enumerate}
\item $Y_i$ is proper over $Y$ for $i = 0, \ldots, n$,
\item $Y_0 \to Y$ is the normalization,
\item $Y_i \to Y_{i - 1}$ is a normalized blowup for $i = 1, \ldots, n$, and
\item $Y_n$ is regular.
\end{enumerate}
\end{definition}

\noindent
Observe that condition (1) implies that the normalization
$Y_0$ of $Y$ is finite over $Y$ and that the normalizations
used in the normalized blowing ups are finite as well.

\begin{lemma}
\label{lemma-existence-implies-existence-by-normalized-blowing-ups}
Let $(A, \mathfrak m, \kappa)$ be a Noetherian local ring.
Assume $A$ is normal and has dimension $2$.
If $\Spec(A)$ has a resolution of singularities,
then $\Spec(A)$ has a resolution by normalized blowups.
\end{lemma}

\begin{proof}
By Lemma \ref{lemma-regular-alteration-implies-local}
the completion $A^\wedge$ of $A$ is normal.
By Lemma \ref{lemma-port-regularity-to-completion} we see
that $\Spec(A^\wedge)$ has a resolution.
By Lemma \ref{lemma-normalized-blowup-completion}
any sequence $Y_n \to Y_{n - 1} \to \ldots \to \Spec(A^\wedge)$
of normalized blowups of comes from a sequence of normalized
blowups $X_n \to \ldots \to \Spec(A)$. Moreover if $Y_n$ is
regular, then $X_n$ is regular by
Lemma \ref{lemma-port-regularity-to-completion}.
Thus it suffices to prove the lemma in case $A$ is complete.

\medskip\noindent
Assume in addition $A$ is a complete. We will use that $A$ is Nagata
(Algebra, Proposition \ref{algebra-proposition-ubiquity-nagata}),
excellent (More on Algebra, Proposition
\ref{more-algebra-proposition-ubiquity-excellent}),
and has a dualizing complex
(Dualizing Complexes, Lemma \ref{dualizing-lemma-ubiquity-dualizing}).
Moreover, the same is true for any ring essentially of finite type over $A$.
If $B$ is a excellent local normal domain, then the completion
$B^\wedge$ is normal (as $B \to B^\wedge$ is regular and
More on Algebra, Lemma \ref{more-algebra-lemma-normal-goes-up} applies).
We will use this without further mention in the rest of the proof.

\medskip\noindent
Let $X \to \Spec(A)$ be a resolution of singularities.
Choose a sequence of normalized blowing ups
$$
Y_n \to Y_{n - 1} \to \ldots \to Y_1 \to \Spec(A)
$$
dominating $X$ (Lemma \ref{lemma-dominate-by-normalized-blowing-up}).
The morphism $Y_n \to X$ is an isomorphism away from
finitely many points of $X$.
Hence we can apply Lemma \ref{lemma-dominate-by-blowing-up-in-points}
to find a sequence of blowing ups
$$
X_m \to X_{m - 1} \to \ldots \to X
$$
in closed points such that $X_m$ dominates $Y_n$. Diagram
$$
\xymatrix{
& Y_n \ar[rd] \ar[rr] & & \Spec(A) \\
X_m \ar[rr] \ar[ru] & & X \ar[ru]
}
$$
To prove the lemma it suffices to show that a finite number of normalized
blowups of $Y_n$ produce a regular scheme. By our diagram above we see that
$Y_n$ has a resolution (namely $X_m$). As $Y_n$ is a normal surface
this implies that $Y_n$ has at most finitely many singularities
$y_1, \ldots, y_t$ (because $X_m \to Y_n$ is an isomorphism away from
the fibres of dimension $1$, see Varieties, Lemma
\ref{varieties-lemma-modification-normal-iso-over-codimension-1}).

\medskip\noindent
Let $x_a \in X$ be the image of $y_a$. Then $\mathcal{O}_{X, x_a}$
is regular and hence defines a rational singularity
(Lemma \ref{lemma-regular-rational}).
Apply Lemma \ref{lemma-rational-propagates} to
$\mathcal{O}_{X, x_a} \to \mathcal{O}_{Y_n, y_a}$
to see that $\mathcal{O}_{Y_n, y_a}$ defines a
rational singularity. By Lemma \ref{lemma-rational-to-gorenstein}
there exists a finite sequence of blowups in singular closed points
$$
Y_{a, n_a} \to Y_{a, n_a - 1} \to \ldots \to \Spec(\mathcal{O}_{Y_n, y_a})
$$
such that $Y_{a, n_a}$ is Gorenstein, i.e., has an
invertible dualizing module. By (the essentially trivial)
Lemma \ref{lemma-equivalence-sequence-blowups}
with $n' = \sum n_a$ these sequences correspond to a sequence of
blowups
$$
Y_{n + n'} \to Y_{n + n' - 1} \to \ldots \to Y_n
$$
such that $Y_{n + n'}$ is normal and
the local rings of $Y_{n + n'}$ are Gorenstein. Using the references
given above we can dominate $Y_{n + n'}$ by a sequence of blowups
$X_{m + m'} \to \ldots \to X_m$ dominating $Y_{n + n'}$ as in the following
$$
\xymatrix{
 & Y_{n + n'} \ar[rr] & & Y_n \ar[rd] \ar[rr] & & \Spec(A) \\
X_{m + m'} \ar[ru] \ar[rr] & & X_m \ar[rr] \ar[ru] & & X \ar[ru]
}
$$
Thus again $Y_{n + n'}$ has a finite number of singular points
$y'_1, \ldots, y'_s$, but this time the singularities are
rational double points, more precisely, the local rings
$\mathcal{O}_{Y_{n + n'}, y'_b}$ are as in
Lemma \ref{lemma-resolve-rational-double-points}.
Arguing exactly as above we conclude that the lemma is true.
\end{proof}

\begin{lemma}
\label{lemma-resolve-complete}
Let $(A, \mathfrak m, \kappa)$ be a Noetherian complete local ring.
Assume $A$ is a normal domain of dimension $2$. Then $\Spec(A)$ has a
resolution of singularities.
\end{lemma}

\begin{proof}
A Noetherian complete local ring is J-2
(More on Algebra, Proposition \ref{more-algebra-proposition-ubiquity-J-2}),
Nagata (Algebra, Proposition \ref{algebra-proposition-ubiquity-nagata}),
excellent (More on Algebra, Proposition
\ref{more-algebra-proposition-ubiquity-excellent}),
and has a dualizing complex
(Dualizing Complexes, Lemma \ref{dualizing-lemma-ubiquity-dualizing}).
Moreover, the same is true for any ring essentially of finite type over $A$.
If $B$ is a excellent local normal domain, then the completion
$B^\wedge$ is normal (as $B \to B^\wedge$ is regular and
More on Algebra, Lemma \ref{more-algebra-lemma-normal-goes-up} applies).
In other words, the local rings which we encounter in the rest of the proof
will have the required ``excellency'' properties required of them.

\medskip\noindent
Choose $A_0 \subset A$ with $A_0$ a regular complete local ring
and $A_0 \to A$ finite, see Algebra, Lemma
\ref{algebra-lemma-complete-local-Noetherian-domain-finite-over-regular}.
This induces a finite extension of fraction fields $K/K_0$.
We will argue by induction on $[K : K_0]$. The base case is
when the degree is $1$ in which case $A_0 = A$ and the result is true.

\medskip\noindent
Suppose there is an intermediate field $K_0 \subset L \subset K$,
$K_0 \not = L \not = K$. Let $B \subset A$ be the integral closure
of $A_0$ in $L$. By induction we choose a resolution of singularities
$Y \to \Spec(B)$. Let $X$ be the normalization
of $Y \times_{\Spec(B)} \Spec(A)$. Picture:
$$
\xymatrix{
X \ar[r] \ar[d] & \Spec(A) \ar[d] \\
Y \ar[r] & \Spec(B)
}
$$
Since $A$ is J-2 the regular locus of $X$ is open. Since $X$
is a normal surface we conclude that $X$ has at worst finitely
many singular points $x_1, \ldots, x_n$ which are closed points with
$\dim(\mathcal{O}_{X, x_i}) = 2$.
For each $i$ let $y_i \in Y$ be the image.
Since
$\mathcal{O}_{Y, y_i}^\wedge \to \mathcal{O}_{X, x_i}^\wedge$
is finite of smaller degree than before we conclude by
induction hypothesis that $\mathcal{O}_{X, x_i}^\wedge$
has resolution of singularities. By
Lemma \ref{lemma-existence-implies-existence-by-normalized-blowing-ups}
there is a sequence
$$
Z^\wedge_{i, n_i} \to \ldots \to Z^\wedge_{i, 1} \to
\Spec(\mathcal{O}_{X, x_i}^\wedge)
$$
of normalized blowups with $Z^\wedge_{i, n_i}$ regular.
By Lemma \ref{lemma-normalized-blowup-completion}
there is a corresponding sequence of normalized blowing ups
$$
Z_{i, n_i} \to \ldots \to Z_{i, 1} \to \Spec(\mathcal{O}_{X, x_i})
$$
Then $Z_{i, n_i}$ is a regular scheme by
Lemma \ref{lemma-port-regularity-to-completion}.
By Lemma \ref{lemma-equivalence-sequence-normalized-blowups}
we can fit these normalized blowing ups
into a corresponding sequence
$$
Z_n \to Z_{n - 1} \to \ldots \to Z_1 \to X
$$
and of course $Z_n$ is regular too (look at the local rings).
This proves the induction step.

\medskip\noindent
Assume there is no intermediate field $K_0 \subset L \subset K$
with $K_0 \not = L \not = K$. Then either $K/K_0$ is separable
or the characteristic to $K$ is $p$ and $[K : K_0] = p$.
Then either Lemma \ref{lemma-go-up-separable} or \ref{lemma-go-up-degree-p}
implies that reduction to rational singularities is possible.
By Lemma \ref{lemma-reduce-to-rational} we conclude that there exists a
normal modification $X \to \Spec(A)$ such that for
every singular point $x$ of $X$ the local ring $\mathcal{O}_{X, x}$
defines a rational singularity. Since $A$ is J-2 we find that $X$ has
finitely many singular points $x_1, \ldots, x_n$.
By Lemma \ref{lemma-rational-to-gorenstein}
there exists a finite sequence of blowups in singular closed points
$$
X_{i, n_i} \to X_{i, n_i - 1} \to \ldots \to \Spec(\mathcal{O}_{X, x_i})
$$
such that $X_{i, n_i}$ is Gorenstein, i.e., has an
invertible dualizing module. By (the essentially trivial)
Lemma \ref{lemma-equivalence-sequence-blowups}
with $n = \sum n_a$ these sequences correspond to a sequence of
blowups
$$
X_n \to X_{n - 1} \to \ldots \to X
$$
such that $X_n$ is normal and the local rings of $X_n$ are Gorenstein.
Again $X_n$ has a finite number of singular points
$x'_1, \ldots, x'_s$, but this time the singularities are
rational double points, more precisely, the local rings
$\mathcal{O}_{X_n, x'_i}$ are as in
Lemma \ref{lemma-resolve-rational-double-points}.
Arguing exactly as above we conclude that the lemma is true.
\end{proof}

\noindent
We finally come to the main theorem of this chapter.

\begin{theorem}[Lipman]
\label{theorem-resolve}
\begin{reference}
\cite[Theorem on page 151]{Lipman}
\end{reference}
Let $Y$ be a two dimensional integral Noetherian scheme. The following are
equivalent
\begin{enumerate}
\item there exists an alteration $X \to Y$ with $X$ regular,
\item there exists a resolution of singularities of $Y$,
\item $Y$ has a resolution of singularities by normalized blowups,
\item the normalization $Y^\nu \to Y$ is finite, $Y^\nu$ has
finitely many singular points $y_1, \ldots, y_m$, and for each
$y_i$ the completion of $\mathcal{O}_{Y^\nu, y_i}$ is normal.
\end{enumerate}
\end{theorem}

\begin{proof}
The implications (3) $\Rightarrow$ (2) $\Rightarrow$ (1) are immediate.

\medskip\noindent
Let $X \to Y$ be an alteration with $X$ regular. Then $Y^\nu \to Y$
is finite by Lemma \ref{lemma-regular-alteration-implies}.
Consider the factorization $f : X \to Y^\nu$ from 
Morphisms, Lemma \ref{morphisms-lemma-normalization-normal}.
The morphism $f$ is finite over an open $V \subset Y^\nu$ containing
every point of codimension $\leq 1$ in $Y^\nu$
by Varieties, Lemma \ref{varieties-lemma-finite-in-codim-1}.
Then $f$ is flat over $V$ by
Algebra, Lemma \ref{algebra-lemma-CM-over-regular-flat}
and the fact that a normal local ring
of dimension $\leq 2$ is Cohen-Macaulay by Serre's criterion
(Algebra, Lemma \ref{algebra-lemma-criterion-normal}).
Then $V$ is regular by Algebra, Lemma \ref{algebra-lemma-descent-regular}.
As $Y^\nu$ is Noetherian we conclude that
$Y^\nu \setminus V = \{y_1, \ldots, y_m\}$ is finite.
By Lemma \ref{lemma-regular-alteration-implies-local}
the completion of $\mathcal{O}_{Y^\nu, y_i}$ is normal.
In this way we see that (1) $\Rightarrow$ (4).

\medskip\noindent
Assume (4). We have to prove (3). We may immediately replace
$Y$ by its normalization. Let $y_1, \ldots, y_m \in Y$ be the
singular points. Applying
Lemmas \ref{lemma-resolve-complete} and
\ref{lemma-existence-implies-existence-by-normalized-blowing-ups}
we find  there exists a finite sequence of normalized blowups
$$
Y_{i, n_i} \to Y_{i, n_i - 1} \to \ldots \to \Spec(\mathcal{O}^\wedge_{Y, y_i})
$$
such that $Y_{i, n_i}$ is regular. By
Lemma \ref{lemma-normalized-blowup-completion}
there is a corresponding sequence of normalized blowing ups
$$
X_{i, n_i} \to \ldots \to X_{i, 1} \to \Spec(\mathcal{O}_{Y, y_i})
$$
Then $X_{i, n_i}$ is a regular scheme by
Lemma \ref{lemma-port-regularity-to-completion}.
By Lemma \ref{lemma-equivalence-sequence-normalized-blowups}
we can fit these normalized blowing ups
into a corresponding sequence
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to Y
$$
and of course $X_n$ is regular too (look at the local rings).
This completes the proof.
\end{proof}






\section{Embedded resolution}
\label{section-embedded}

\noindent
Given a curve on a surface there is a blowing up which turns the
curve into a strict normal crossings divisor. In this section we
will use that a one dimensional locally Noetherian scheme is normal if
and only if it is regular
(Algebra, Lemma \ref{algebra-lemma-characterize-dvr}).
We will also use that any point on a locally Noetherian
scheme specializes to a closed point
(Properties, Lemma \ref{properties-lemma-locally-Noetherian-closed-point}).

\begin{lemma}
\label{lemma-resolve-curve}
Let $Y$ be a one dimensional integral Noetherian scheme.
The following are equivalent
\begin{enumerate}
\item there exists an alteration $X \to Y$ with $X$ regular,
\item there exists a resolution of singularities of $Y$,
\item there exists a finite sequence
$Y_n \to Y_{n - 1} \to \ldots \to Y_1 \to Y$ of blowups
in closed points with $Y_n$ regular, and
\item the normalization $Y^\nu \to Y$ is finite.
\end{enumerate}
\end{lemma}

\begin{proof}
The implications (3) $\Rightarrow$ (2) $\Rightarrow$ (1) are immediate.
The implication (1) $\Rightarrow$ (4) follows from
Lemma \ref{lemma-regular-alteration-implies}.
Observe that a normal one dimensional scheme is regular hence
the implication (4) $\Rightarrow$ (2) is clear as well.
Thus it remains to show that the equivalent conditions (1), (2), and
(4) imply (3).

\medskip\noindent
Let $f : X \to Y$ be a resolution of singularities. Since the dimension
of $Y$ is one we see that $f$ is finite by
Varieties, Lemma \ref{varieties-lemma-finite-in-codim-1}.
We will construct factorizations
$$
X \to \ldots \to Y_2 \to Y_1 \to Y
$$
where $Y_i \to Y_{i - 1}$ is a blowing up of a closed point and not
an isomorphism as long as $Y_{i - 1}$ is not regular.
Each of these morphisms will be finite (by the same
reason as above) and we will get a corresponding system
$$
f_*\mathcal{O}_X \supset \ldots \supset
f_{2, *}\mathcal{O}_{Y_2} \supset
f_{1, *}\mathcal{O}_{Y_1} \supset \mathcal{O}_Y
$$
where $f_i : Y_i \to Y$ is the structure morphism.
Since $Y$ is Noetherian, this increasing sequence of coherent submodules
must stabilize
(Cohomology of Schemes, Lemma \ref{coherent-lemma-acc-coherent})
which proves that for some $n$ the scheme $Y_n$ is regular
as desired. To construct $Y_i$ given $Y_{i - 1}$ we pick a singular
closed point $y_{i - 1} \in Y_{i - 1}$ and we let $Y_i \to Y_{i - 1}$
be the corresponding blowup. Since $X$ is regular of dimension $1$
(and hence the local rings at closed points are discrete valuation
rings and in particular PIDs), the ideal sheaf
$\mathfrak m_{y_{i - 1}} \cdot \mathcal{O}_X$ is invertible.
By the universal property of blowing up (Divisors, Lemma
\ref{divisors-lemma-universal-property-blowing-up})
this gives us a factorization
$X \to Y_i$.
Finally, $Y_i \to Y_{i - 1}$ is not an isomorphism as
$\mathfrak m_{y_{i - 1}}$ is not an invertible ideal.
\end{proof}

\begin{lemma}
\label{lemma-blowup-curve}
Let $X$ be a Noetherian scheme. Let $Y \subset X$ be an integral closed
subscheme of dimension $1$ satisfying the equivalent conditions of
Lemma \ref{lemma-resolve-curve}. Then there exists a finite sequence
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to X
$$
of blowups in closed points such that the strict transform of $Y$
in $X_n$ is a regular curve.
\end{lemma}

\begin{proof}
Let $Y_n \to Y_{n - 1} \to \ldots \to Y_1 \to Y$ be the sequence of
blowups given to us by Lemma \ref{lemma-resolve-curve}. Let
$X_n \to X_{n - 1} \to \ldots \to X_1 \to X$ be the corresponding
sequence of blowups of $X$. This works because the strict transform
is the blowup by Divisors, Lemma \ref{divisors-lemma-strict-transform}.
\end{proof}

\noindent
Let $X$ be a locally Noetherian scheme. Let $Y, Z \subset X$ be
closed subschemes. Let $p \in Y \cap Z$ be a closed point. Assume
that $Y$ is integral of dimension $1$ and that the generic point of $Y$
is not contained in $Z$. In this situation we can
consider the invariant
\begin{equation}
\label{equation-multiplicity}
m_p(Y \cap Z) =
\text{length}_{\mathcal{O}_{X, p}}(\mathcal{O}_{Y \cap Z, p})
\end{equation}
This is an integer $\geq 1$. Namely, if $I, J \subset \mathcal{O}_{X, p}$
are the ideals corresponding to $Y, Z$, then we see that
$\mathcal{O}_{Y \cap Z, p} = \mathcal{O}_{X, p}/I + J$
has support equal to $\{\mathfrak m_p\}$ because we assumed that
$Y \cap Z$ does not contain the unique point of $Y$ specializing to $p$.
Hence the length is finite by
Algebra, Lemma \ref{algebra-lemma-support-point}.

\begin{lemma}
\label{lemma-blowup-nonsingular-curves-meeting-at-point}
In the situation above let $X' \to X$ be the blowing up of $X$ in $p$.
Let $Y', Z' \subset X'$ be the strict transforms of $Y, Z$.
If $\mathcal{O}_{Y, p}$ is regular, then
\begin{enumerate}
\item $Y' \to Y$ is an isomorphism,
\item $Y'$ meets the exceptional fibre $E \subset X'$ in one point
$q$ and $m_q(Y \cap E) = 1$,
\item if $q \in Z'$ too, then $m_q(Y \cap Z') < m_p(Y \cap Z)$.
\end{enumerate}
\end{lemma}

\begin{proof}
Since $\mathcal{O}_{X, p} \to \mathcal{O}_{Y, p}$ is surjective and
$\mathcal{O}_{Y, p}$ is a discrete valuation ring, we can pick an
element $x_1 \in \mathfrak m_p$ mapping to a uniformizer in
$\mathcal{O}_{Y, p}$. Choose an affine open $U = \Spec(A)$ containing
$p$ such that $x_1 \in A$. Let $\mathfrak m \subset A$ be the
maximal ideal corresponding to $p$. Let $I, J \subset A$
be the ideals defining $Y, Z$ in $\Spec(A)$. After shrinking $U$
we may assume that $\mathfrak m = I + (x_1)$, in other words,
that $V(x_1) \cap U \cap Y = \{p\}$ scheme theoretically.
We conclude that $p$ is an effective Cartier divisor on $Y$ and
since $Y'$ is the blowing up of $Y$ in $p$
(Divisors, Lemma \ref{divisors-lemma-strict-transform})
we see that $Y' \to Y$ is an isomorphism by
Divisors, Lemma \ref{divisors-lemma-blow-up-effective-Cartier-divisor}.
The relationship $\mathfrak m = I + (x_1)$ implies that
$\mathfrak m^n \subset I + (x_1^n)$ hence we can define a map
$$
\psi : A[\textstyle{\frac{\mathfrak m}{x_1}}] \longrightarrow A/I
$$
by sending $y/x_1^n \in A[\frac{\mathfrak m}{x_1}]$
to the class of $a$ in $A/I$ where $a$
is chosen such that $y \equiv ax_1^n \bmod I$.
Then $\psi$ corresponds to the morphism of $Y \cap U$ into $X'$
over $U$ given by $Y' \cong Y$. Since the image of $x_1$
in $A[\frac{\mathfrak m}{x_1}]$ cuts out the exceptional divisor
we conclude that $m_q(Y', E) = 1$. Finally, since
$J \subset \mathfrak m$ implies that the ideal
$J' \subset A[\frac{\mathfrak m}{x_1}]$ certainly
contains the elements $f/x_1$ for $f \in J$.
Thus if we choose $f \in J$ whose image $\overline{f}$ in $A/I$ has
minimal valuation equal to $m_p(Y \cap Z)$, then we see that
$\psi(f/x_1) = \overline{f}/x_1$ in $A/I$ has valuation one less
proving the last part of the lemma.
\end{proof}

\begin{lemma}
\label{lemma-blowup-curves}
Let $X$ be a Noetherian scheme. Let $Y_i \subset X$, $i = 1, \ldots, n$
be an integral closed subschemes of dimension $1$ each satisfying the
equivalent conditions of Lemma \ref{lemma-resolve-curve}. Then there
exists a finite sequence
$$
X_n \to X_{n - 1} \to \ldots \to X_1 \to X
$$
of blowups in closed points such that the strict transform $Y'_i \subset X_n$
of $Y_i$ in $X_n$ are pairwise disjoint regular curves.
\end{lemma}

\begin{proof}
It follows from Lemma \ref{lemma-blowup-curve} that we may assume $Y_i$
is a regular curve for $i = 1, \ldots, n$. For every $i \not = j$
and $p \in Y_i \cap Y_j$ we have the invariant
$m_p(Y_i \cap Y_j)$ (\ref{equation-multiplicity}).
If the maximum of these numbers is $> 1$, then we can decrease
it (Lemma \ref{lemma-blowup-nonsingular-curves-meeting-at-point})
by blowing up in all the points $p$ where the maximum is attained.
If the maximum is $1$ then we can separate the curves using the
same lemma by blowing up in all these points $p$.
\end{proof}

\noindent
When our curve is contained on a regular surface we often want to
turn it into a divisor with normal crossings.

\begin{lemma}
\label{lemma-turn-into-effective-Cartier}
Let $X$ be a regular scheme of dimension $2$. Let $Z \subset X$
be a proper closed subscheme. There exists a sequence
$$
X_n \to \ldots \to X_1 \to X
$$
of blowing ups in closed points such that the inverse image $Z_n$ of $Z$
in $X_n$ is an effective Cartier divisor.
\end{lemma}

\begin{proof}
Let $D \subset Z$ be the largest effective Cartier divisor contained in $Z$.
Then $\mathcal{I}_Z \subset \mathcal{I}_D$ and the quotient is supported
in closed points by Divisors, Lemma \ref{divisors-lemma-codim-1-part}.
Thus we can write $\mathcal{I}_Z = \mathcal{I}_{Z'} \mathcal{I}_D$
where $Z' \subset X$ is a closed subscheme which set theoretically
consists of finitely many closed points. Applying
Lemma \ref{lemma-make-ideal-principal}
we find a sequence of blowups as in the statement of our lemma
such that $\mathcal{I}_{Z'}\mathcal{O}_{X_n}$ is invertible.
This proves the lemma.
\end{proof}

\begin{lemma}
\label{lemma-embedded-resolution}
Let $X$ be a regular scheme of dimension $2$. Let $Z \subset X$
be a proper closed subscheme such that every irreducible component
$Y \subset Z$ of dimension $1$ satisfies the equivalent conditions of
Lemma \ref{lemma-resolve-curve}. Then there exists a sequence
$$
X_n \to \ldots \to X_1 \to X
$$
of blowups in closed points such that the inverse image $Z_n$ of $Z$
in $X_n$ is an effective Cartier divisor supported on a strict normal crossings
divisor.
\end{lemma}

\begin{proof}
Let $X' \to X$ be a blowup in a closed point $p$. Then the inverse image
$Z' \subset X'$ of $Z$ is supported on the strict transform of $Z$ and
the exceptional divisor. The exceptional divisor is a regular curve
(Lemma \ref{lemma-blowup}) and the strict transform $Y'$ of each irreducible
component $Y$ is either equal to $Y$ or the blowup of $Y$ at $p$.
Thus in this process we do not produce additional singular components
of dimension $1$. Thus it follows from
Lemmas \ref{lemma-turn-into-effective-Cartier} and \ref{lemma-blowup-curves}
that we may assume $Z$ is an effective Cartier divisor and
that all irreducible components $Y$ of $Z$ are regular.
(Of course we cannot assume the irreducible components are
pairwise disjoint because in each blowup of a point of $Z$
we add a new irreducible component to $Z$, namely the exceptional divisor.)

\medskip\noindent
Assume $Z$ is an effective Cartier divisor whose irreducible components
$Y_i$ are regular. For every $i \not = j$
and $p \in Y_i \cap Y_j$ we have the invariant
$m_p(Y_i \cap Y_j)$ (\ref{equation-multiplicity}).
If the maximum of these numbers is $> 1$, then we can decrease
it (Lemma \ref{lemma-blowup-nonsingular-curves-meeting-at-point})
by blowing up in all the points $p$ where the maximum is attained
(note that the ``new'' invariants $m_{q_i}(Y'_i \cap E)$ are always $1$).
If the maximum is $1$ then, if $p \in Y_1 \cap \ldots \cap Y_r$
for some $r > 2$ and not any of the others (for example), then after
blowing up $p$ we see that $Y'_1, \ldots, Y'_r$ do not meet in points
above $p$ and $m_{q_i}(Y'_i, E) = 1$ where $Y'_i \cap E = \{q_i\}$.
Thus continuing to blowup points where more than $3$
of the components of $Z$ meet, we reach the situation where
for every closed point $p \in X$ there is either
(a) no curves $Y_i$ passing through $p$,
(b) exactly one curve $Y_i$ passing through $p$ and $\mathcal{O}_{Y_i, p}$
is regular, or (c) exactly two curves $Y_i$, $Y_j$ passing through
$p$, the local rings $\mathcal{O}_{Y_i, p}$, $\mathcal{O}_{Y_j, p}$
are regular and $m_p(Y_i \cap Y_j) = 1$.
This means that $\sum Y_i$ is a strict normal crossings
divisor on the regular surface $X$, see
\'Etale Morphisms, Lemma
\ref{etale-lemma-strict-normal-crossings}.
\end{proof}






\section{Contracting exceptional curves}
\label{section-minus-one}

\noindent
Let $X$ be a Noetherian scheme. Let $E \subset X$ be a closed
subscheme with the following properties
\begin{enumerate}
\item $E$ is an effective Cartier divisor on $X$,
\item there exists a field $k$ and an isomorphism $\mathbf{P}^1_k \to E$
of schemes,
\item the normal sheaf $\mathcal{N}_{E/X}$ pulls back to
$\mathcal{O}_{\mathbf{P}^1}(-1)$.
\end{enumerate}
Such a closed subscheme is called an {\it exceptional curve of the first kind}.

\medskip\noindent
Let $X'$ be a Noetherian scheme and let $x \in X'$ be a closed point
such that $\mathcal{O}_{X', x}$ is regular of dimension $2$. Let
$b : X \to X'$ be the blowing up of $X'$ at $x$. In this case the
exceptional fibre $E \subset X$ is an exceptional curve of the first
kind. This follows from Lemma \ref{lemma-blowup}.

\medskip\noindent
Question: Is every exceptional curve of the first kind obtained
as the fibre of a blowing up as above? In other words, does there
always exist a proper morphism of schemes $X \to X'$ such that
$E$ maps to a closed point $x \in X'$, such that $\mathcal{O}_{X', x}$
is regular of dimension $2$, and such that $X$ is the blowing up
of $X'$ at $x$. If true we say {\it there exists a contraction of $E$}.

\begin{lemma}
\label{lemma-factor-through-contraction}
Let $X$ be a Noetherian scheme. Let $E \subset X$ be an
exceptional curve of the first kind. If a contraction $X \to X'$
of $E$ exists, then it has the following universal property:
for every morphism $\varphi : X \to Y$ such that $\varphi(E)$
is a point, there is a unique factorization
$X \to X' \to Y$ of $\varphi$.
\end{lemma}

\begin{proof}
Let $b : X \to X'$ be a contraction of $E$. As a topological space
$X'$ is the quotient of $X$ by the relation identifying all points
of $E$ to one point. Namely, $b$ is proper
(Divisors, Lemma \ref{divisors-lemma-blowing-up-projective} and
Morphisms, Lemma \ref{morphisms-lemma-locally-projective-proper})
and surjective, hence defines a submersive map of topological
spaces (Topology, Lemma
\ref{topology-lemma-closed-morphism-quotient-topology}).
On the other hand, the canonical map
$\mathcal{O}_{X'} \to b_*\mathcal{O}_X$ is an isomorphism. Namely,
this is clear over the complement of the image point $x \in X'$ of $E$
and on stalks at $x$ the map is an isomorphism by part (4) of
Lemma \ref{lemma-cohomology-of-blowup}.
Thus the pair $(X', \mathcal{O}_{X'})$ is constructed
from $X$ by taking the quotient as a topological space
and endowing this with $b_*\mathcal{O}_X$ as structure sheaf.

\medskip\noindent
Given $\varphi$ we can let $\varphi' : X' \to Y$ be the unique map of
topological spaces such that $\varphi = \varphi' \circ b$.
Then the map
$$
\varphi^\sharp : \varphi^{-1}\mathcal{O}_Y =
b^{-1}((\varphi')^{-1}\mathcal{O}_Y) \to \mathcal{O}_X
$$
is adjoint to a map
$$
(\varphi')^\sharp :
(\varphi')^{-1}\mathcal{O}_Y \to b_*\mathcal{O}_X = \mathcal{O}_{X'}
$$
Then $(\varphi', (\varphi')^\sharp)$ is a morphism of ringed spaces
from $X'$ to $Y$ such that we get the desired factorization. Since
$\varphi$ is a morphism of locally ringed spaces, it follows that
$\varphi'$ is too. Namely, the only thing to check is that the map
$\mathcal{O}_{Y, y} \to \mathcal{O}_{X', x}$ is local, where $y \in Y$
is the image of $E$ under $\varphi$. This is true because an element
$f \in \mathfrak m_y$ pulls back to a function on $X$ which is zero
in every point of $E$ hence the pull back of $f$ to $X'$ is a function
defined on a neighbourhood of $x$ in $X'$ with the same property.
Then it is clear that this function must vanish at $x$ as desired.
\end{proof}

\begin{lemma}
\label{lemma-contraction-unique}
Let $X$ be a Noetherian scheme. Let $E \subset X$ be an
exceptional curve of the first kind. If there exists a contraction
of $E$, then it is unique up to unique isomorphism.
\end{lemma}

\begin{proof}
This is immediate from the universal property of
Lemma \ref{lemma-factor-through-contraction}.
\end{proof}

\begin{lemma}
\label{lemma-exceptional-first-kind-local}
Let $X$ be a Noetherian scheme. Let $E \subset X$ be an
exceptional curve of the first kind. Let $E_n = nE$ and
denote $\mathcal{O}_n$ its structure sheaf. Then
$$
A = \lim H^0(E_n, \mathcal{O}_n)
$$
is a complete local Noetherian regular local ring of dimension $2$
and $\Ker(A \to H^0(E_n, \mathcal{O}_n))$ is the $n$th power of
its maximal ideal.
\end{lemma}

\begin{proof}
Recall that there exists an isomorphism $\mathbf{P}^1_k \to E$
such that the normal sheaf of $E$ in $X$ pulls back to $\mathcal{O}(-1)$.
Then $H^0(E, \mathcal{O}_E) = k$.
We will denote $\mathcal{O}_n(iE)$ the restriction of the invertible
sheaf $\mathcal{O}_X(iE)$ to $E_n$ for all $n \geq 1$ and $i \in \mathbf{Z}$.
Recall that $\mathcal{O}_X(-nE)$ is the ideal sheaf of $E_n$. Hence
for $d \geq 0$ we obtain a short exact sequence
$$
0 \to \mathcal{O}_E(-(d + n)E) \to
\mathcal{O}_{n + 1}(-dE) \to
\mathcal{O}_n(-dE) \to 0
$$
Since $\mathcal{O}_E(-(d + n)E) = \mathcal{O}_{\mathbf{P}^1_k}(d + n)$
the first cohomology group vanishes for all $d \geq 0$ and $n \geq 1$.
We conclude that the transition maps of the system
$H^0(E_n, \mathcal{O}_n(-dE))$ are surjective. For $d = 0$
we get an inverse system of surjections of rings such that the
kernel of each transition map is a nilpotent ideal.
Hence $A = \lim H^0(E_n, \mathcal{O}_n)$ is a local ring
with residue field $k$ and maximal ideal
$$
\lim \Ker(H^0(E_n, \mathcal{O}_n) \to H^0(E, \mathcal{O}_E)) =
\lim H^0(E_n, \mathcal{O}_n(-E))
$$
Pick $x, y$ in this kernel mapping to a $k$-basis of
$H^0(E, \mathcal{O}_E(-E)) = H^0(\mathbf{P}^1_k, \mathcal{O}(1))$.
Then $x^d, x^{d - 1}y, \ldots, y^d$ are
elements of $\lim H^0(E_n, \mathcal{O}_n(-dE))$ which map to a basis
of $H^0(E, \mathcal{O}_E(-dE)) = H^0(\mathbf{P}^1_k, \mathcal{O}(d))$.
In this way we see that $A$ is separated and complete with respect
to the linear topology defined by the kernels
$$
I_n = \Ker(A \longrightarrow H^0(E_n, \mathcal{O}_n))
$$
We have $x, y \in I_1$, $I_d I_{d'} \subset I_{d + d'}$
and $I_d/I_{d + 1}$ is a free $k$-module on $x^d, x^{d - 1}y, \ldots, y^d$.
We will show that $I_d = (x, y)^d$. Namely, if $z_e \in I_e$ with
$e \geq d$, then we can write
$$
z_e = a_{e, 0} x^d + a_{e, 1} x^{d - 1}y + \ldots + a_{e, d}y^d + z_{e + 1}
$$
where $a_{e, j} \in (x, y)^{e - d}$ and $z_{e + 1} \in I_{e + 1}$
by our description of $I_d/I_{d + 1}$. Thus starting with some
$z = z_d \in I_d$ we can do this inductively
$$
z = \sum\nolimits_{e \geq d} \sum\nolimits_j a_{e, j} x^{d - j} y^j
$$
with some $a_{e, j} \in (x, y)^{e - d}$. Then $a_j = \sum_{e \geq d} a_{e, j}$
exists (by completeness and the fact that $a_{e, j} \in I_{e - d}$)
and we have $z = \sum a_{e, j} x^{d - j} y^j$.
Hence $I_d = (x, y)^d$.
Thus $A$ is $(x, y)$-adically complete. Then $A$ is
Noetherian by Algebra, Lemma \ref{algebra-lemma-completion-Noetherian}.
It is clear that the dimension is $2$ by the description
of $(x, y)^d/(x, y)^{d + 1}$ and
Algebra, Proposition \ref{algebra-proposition-dimension}.
Since the maximal ideal
is generated by two elements it is regular.
\end{proof}

\begin{lemma}
\label{lemma-contraction}
Let $X$ be a Noetherian scheme. Let $E \subset X$ be an
exceptional curve of the first kind. If there exists a morphism
$f : X \to Y$ such that
\begin{enumerate}
\item $Y$ is Noetherian,
\item $f$ is proper,
\item $f$ maps $E$ to a point $y$ of $Y$,
\item $f$ is quasi-finite at every point not in $E$,
\end{enumerate}
Then there exists a contraction of $E$ and it is the Stein
factorization of $f$.
\end{lemma}

\begin{proof}
We apply More on Morphisms, Theorem
\ref{more-morphisms-theorem-stein-factorization-Noetherian}
to get a Stein factorization $X \to X' \to Y$.
Then $X \to X'$ satisfies all the hypotheses of
the lemma (some details omitted).
Thus after replacing $Y$ by $X'$ we may in addition
assume that $f_*\mathcal{O}_X = \mathcal{O}_Y$ and
that the fibres of $f$ are geometrically connected.

\medskip\noindent
Assume that $f_*\mathcal{O}_X = \mathcal{O}_Y$ and
that the fibres of $f$ are geometrically connected.
Note that $y \in Y$ is a closed point as $f$ is closed and $E$ is closed.
The restriction $f^{-1}(Y \setminus \{y\}) \to Y \setminus \{y\}$
of $f$ is a finite morphism
(More on Morphisms, Lemma \ref{more-morphisms-lemma-characterize-finite}).
Hence this restriction is an isomorphism since
$f_*\mathcal{O}_X = \mathcal{O}_Y$ since finite morphisms are affine.
To prove that $\mathcal{O}_{Y, y}$ is regular of dimension
$2$ we consider the isomorphism
$$
\mathcal{O}_{Y, y}^\wedge \longrightarrow
\lim H^0(X \times_Y \Spec(\mathcal{O}_{Y, y}/\mathfrak m_y^n), \mathcal{O})
$$
of Cohomology of Schemes, Lemma \ref{coherent-lemma-formal-functions-stalk}.
Let $E_n = nE$ as in Lemma \ref{lemma-exceptional-first-kind-local}.
Observe that
$$
E_n \subset X \times_Y \Spec(\mathcal{O}_{Y, y}/\mathfrak m_y^n)
$$
because $E \subset X_y = X \times_Y \Spec(\kappa(y))$.
On the other hand, since $E = f^{-1}(\{y\})$ set theoretically
(because the fibres of $f$ are geometrically connected), we see that
the scheme theoretic fibre $X_y$ is scheme theoretically contained in
$E_n$ for some $n > 0$. Namely, apply
Cohomology of Schemes, Lemma \ref{coherent-lemma-power-ideal-kills-sheaf}
to the coherent $\mathcal{O}_X$-module $\mathcal{F} = \mathcal{O}_{X_y}$
and the ideal sheaf $\mathcal{I}$ of $E$ and use that
$\mathcal{I}^n$ is the ideal sheaf of $E_n$. This shows that
$$
X \times_Y \Spec(\mathcal{O}_{Y, y}/\mathfrak m_y^m) \subset E_{nm}
$$
Thus the inverse limit displayed above is equal to
$\lim H^0(E_n, \mathcal{O}_n)$
which is a regular two dimensional local ring by
Lemma \ref{lemma-exceptional-first-kind-local}.
Hence $\mathcal{O}_{Y, y}$ is a two dimensional regular local
ring because its completion is so
(More on Algebra, Lemma \ref{more-algebra-lemma-completion-regular} and
\ref{more-algebra-lemma-completion-dimension}).

\medskip\noindent
We still have to prove that $f : X \to Y$ is the blowup $b : Y' \to Y$
of $Y$ at $y$. We encourage the reader to find her own proof.
First, we note that Lemma \ref{lemma-exceptional-first-kind-local}
also implies that $X_y = E$ scheme theoretically.
Since the ideal sheaf of $E$ is invertible, this shows
that $f^{-1}\mathfrak m_y \cdot \mathcal{O}_X$ is invertible.
Hence we obtain a factorization
$$
X \to Y' \to Y
$$
of the morphism $f$ by the universal property of blowing up, see
Divisors, Lemma \ref{divisors-lemma-universal-property-blowing-up}.
Recall that the exceptional fibre of $E' \subset Y'$ is an exceptional
curve of the first kind by Lemma \ref{lemma-blowup}.
Let $g : E \to E'$ be the induced morphism.
Because for both $E'$ and $E$ the conormal sheaf is generated
by (pullbacks of) $a$ and $b$, we see that the canonical map
$g^*\mathcal{C}_{E'/Y'} \to \mathcal{C}_{E/X}$
(Morphisms, Lemma \ref{morphisms-lemma-conormal-functorial})
is surjective. Since both are invertible, this map is an isomorphism.
Since $\mathcal{C}_{E/X}$ has positive degree, it follows that $g$
cannot be a constant morphism.
Hence $g$ has finite fibres. Hence $g$ is a finite morphism
(same reference as above). However, since $Y'$ is regular
(and hence normal) at all points of $E'$ and since $X \to Y'$
is birational and an isomorphism away from $E'$, we conclude
that $X \to Y'$ is an isomorphism by
Varieties, Lemma
\ref{varieties-lemma-modification-normal-iso-over-codimension-1}.
\end{proof}

\begin{lemma}
\label{lemma-pic-blowup}
Let $b : X \to X'$ be the contraction of an
exceptional curve of the first kind $E \subset X$.
Then there is a short exact sequence
$$
0 \to \Pic(X') \to \Pic(X) \to \mathbf{Z} \to 0
$$
where the first map is pullback by $b$ and the second map sends
$\mathcal{L}$ to the degree of $\mathcal{L}$ on the exceptional
curve $E$. The sequence is split by the map
$n \mapsto \mathcal{O}_X(-nE)$.
\end{lemma}

\begin{proof}
Since $E = \mathbf{P}^1_k$ we see that the Picard group of $E$
is $\mathbf{Z}$, see Divisors, Lemma
\ref{divisors-lemma-Pic-projective-space-UFD}.
Hence we can think of the last map as $\mathcal{L} \mapsto \mathcal{L}|_E$.
The degree of the restriction of $\mathcal{O}_X(E)$ to $E$ is $-1$
by definition of exceptional curves of the first kind. Combining these
remarks we see that it
suffices to show that $\Pic(X') \to \Pic(X)$ is injective
with image the invertible sheaves restricting to $\mathcal{O}_E$ on $E$.

\medskip\noindent
Given an invertible $\mathcal{O}_{X'}$-module
$\mathcal{L}'$ we claim the map $\mathcal{L}' \to b_*b^*\mathcal{L}'$
is an isomorphism. This is clear everywhere except possibly at the image
point $x \in X'$ of $E$. To check it is an isomorphism on stalks
at $x$ we may replace $X'$ by an open neighbourhood at $x$ and
assume $\mathcal{L}'$ is $\mathcal{O}_{X'}$. Then we have to
show that the map $\mathcal{O}_{X'} \to b_*\mathcal{O}_X$
is an isomorphism. This follows from Lemma \ref{lemma-cohomology-of-blowup}
part (4).

\medskip\noindent
Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module with
$\mathcal{L}|_E = \mathcal{O}_E$. Then we claim 
(1) $b_*\mathcal{L}$ is invertible and
(2) $b^*b_*\mathcal{L} \to \mathcal{L}$ is an isomorphism.
Statements (1) and (2) are clear over $X' \setminus \{x\}$.
Thus it suffices to prove (1) and (2) after base change
to $\Spec(\mathcal{O}_{X', x})$.
Computing $b_*$ commutes with flat base change
(Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology})
and similarly for $b^*$ and formation of the adjunction map.
But if $X'$ is the spectrum of a regular local ring
then $\mathcal{L}$ is trivial by the description of
the Picard group in Lemma \ref{lemma-blowup-pic}. Thus
the claim is proved.

\medskip\noindent
Combining the claims proved in the previous two paragraphs we
see that the map $\mathcal{L} \mapsto b_*\mathcal{L}$
is an inverse to the map
$$
\Pic(X') \longrightarrow \Ker(\Pic(X) \to \Pic(E))
$$
and the lemma is proved.
\end{proof}

\begin{remark}
\label{remark-pic-blowup}
Let $b : X \to X'$ be the contraction of an
exceptional curve of the first kind $E \subset X$.
From Lemma \ref{lemma-pic-blowup} we obtain an identification
$$
\Pic(X) = \Pic(X') \oplus \mathbf{Z}
$$
where $\mathcal{L}$ corresponds to the pair $(\mathcal{L}', n)$ if and only if
$\mathcal{L} = (b^*\mathcal{L}')(-nE)$, i.e.,
$\mathcal{L}(nE) = b^*\mathcal{L}'$. In fact the proof of
Lemma \ref{lemma-pic-blowup} shows that $\mathcal{L}' = b_*\mathcal{L}(nE)$.
Of course the assignment $\mathcal{L} \mapsto \mathcal{L}'$ is
a group homomorphism.
\end{remark}

\begin{lemma}
\label{lemma-lift-sections-and-h1}
Let $X$ be a Noetherian scheme. Let $E \subset X$ be an
exceptional curve of the first kind. Let $\mathcal{L}$ be
an invertible $\mathcal{O}_X$-module.
Let $n$ be the integer such that $\mathcal{L}|_E$ has degree $n$
viewed as an invertible module on $\mathbf{P}^1$. Then
\begin{enumerate}
\item If $H^1(X, \mathcal{L}) = 0$ and $n \geq 0$, then
$H^1(X, \mathcal{L}(iE)) = 0$ for $0 \leq i \leq n + 1$.
\item If $n \leq 0$, then
$H^1(X, \mathcal{L}) \subset H^1(X, \mathcal{L}(E))$.
\end{enumerate}
\end{lemma}

\begin{proof}
Observe that $\mathcal{L}|_E = \mathcal{O}(n)$ by
Divisors, Lemma \ref{divisors-lemma-Pic-projective-space-UFD}.
Use induction, the long exact cohomology sequence associated to the
short exact sequence
$$
0 \to \mathcal{L} \to \mathcal{L}(E) \to \mathcal{L}(E)|_E \to 0,
$$
and use the fact that $H^1(\mathbf{P}^1, \mathcal{O}(d)) = 0$ for
$d \geq -1$ and $H^0(\mathbf{P}^1, \mathcal{O}(d)) = 0$ for
$d \leq -1$. Some details omitted.
\end{proof}

\begin{lemma}
\label{lemma-contract-ample}
Let $S = \Spec(R)$ be an affine Noetherian scheme.
Let $X \to S$ be a proper morphism. Let $\mathcal{L}$ be an
ample invertible sheaf on $X$. Let $E \subset X$ be an
exceptional curve of the first kind. Then
\begin{enumerate}
\item there exists a contraction $b : X \to X'$ of $E$,
\item $X'$ is proper over $S$, and
\item the invertible $\mathcal{O}_{X'}$-module $\mathcal{L}'$
is ample with $\mathcal{L}'$ as in Remark \ref{remark-pic-blowup}.
\end{enumerate}
\end{lemma}

\begin{proof}
Let $n$ be the degree of $\mathcal{L}|_E$ as in
Lemma \ref{lemma-lift-sections-and-h1}.
Observe that $n > 0$ as $\mathcal{L}$ is ample on $E$
(Varieties, Lemma \ref{varieties-lemma-ample-curve} and
Properties, Lemma \ref{properties-lemma-ample-on-closed}).
After replacing $\mathcal{L}$ by a power we may assume
$H^i(X, \mathcal{L}^{\otimes e}) = 0$ for all $i > 0$ and $e > 0$, see
Cohomology of Schemes,
Lemma \ref{coherent-lemma-vanshing-gives-ample}.
Finally, after replacing $\mathcal{L}$ by another power we may assume
there exist global sections $t_0, \ldots, t_n$ of $\mathcal{L}$
which define a closed immersion $\psi : X \to \mathbf{P}^n_S$, see
Morphisms, Lemma
\ref{morphisms-lemma-finite-type-over-affine-ample-very-ample}.

\medskip\noindent
Set $\mathcal{M} = \mathcal{L}(nE)$. Then $\mathcal{M}|_E \cong \mathcal{O}_E$.
Since we have the short exact sequence
$$
0 \to \mathcal{M}(-E) \to \mathcal{M} \to \mathcal{O}_E \to 0
$$
and since $H^1(X, \mathcal{M}(-E))$ is zero
(by Lemma \ref{lemma-lift-sections-and-h1} and the fact that $n > 0$)
we can pick a section $s_{n + 1}$ of $\mathcal{M}$ which generates
$\mathcal{M}|_E$.
Finally, denote $s_0, \ldots, s_n$ the sections of $\mathcal{M}$
we get from the sections $t_0, \ldots, t_n$ of $\mathcal{L}$
chosen above via $\mathcal{L} \subset \mathcal{L}(nE) = \mathcal{M}$.
Combined the sections $s_0, \ldots, s_n, s_{n + 1}$
generate $\mathcal{M}$ in every point of $X$ and therefore define
a morphism
$$
\varphi : X \longrightarrow \mathbf{P}^{n + 1}_S
$$
over $S$, see Constructions, Lemma \ref{constructions-lemma-projective-space}.

\medskip\noindent
Below we will check the conditions of Lemma \ref{lemma-contraction}.
Once this is done we see that the Stein factorization
$X \to X' \to \mathbf{P}^{n + 1}_S$ of $\varphi$ is the desired contraction
which proves (1).
Moreover, the morphism $X' \to \mathbf{P}^{n + 1}_S$ is finite
hence $X'$ is proper over $S$
(Morphisms, Lemmas \ref{morphisms-lemma-finite-proper} and
\ref{morphisms-lemma-composition-proper}). This proves (2).
Observe that $X'$ has an ample invertible sheaf. Namely the pullback
$\mathcal{M}'$ of $\mathcal{O}_{\mathbf{P}^{n + 1}_S}(1)$ is ample by
Morphisms, Lemma \ref{morphisms-lemma-pullback-ample-tensor-relatively-ample}.
Observe that $\mathcal{M}'$ pulls back to $\mathcal{M}$ on $X$
(by Constructions, Lemma \ref{constructions-lemma-projective-space}).
Finally, $\mathcal{M} = \mathcal{L}(nE)$. Since in the arguments above
we have replaced the original $\mathcal{L}$ by a positive power
we conclude that the invertible $\mathcal{O}_{X'}$-module $\mathcal{L}'$
mentioned in (3) of the lemma is ample on $X'$ by
Properties, Lemma \ref{properties-lemma-ample-power-ample}.

\medskip\noindent
Easy observations: $\mathbf{P}^{n + 1}_S$ is Noetherian and $\varphi$ is proper.
Details omitted.

\medskip\noindent
Next, we observe that any point of $U = X \setminus E$ is mapped
to the open subscheme $W$ of $\mathbf{P}^{n + 1}_S$ where one of the
first $n + 1$ homogeneous coordinates is nonzero. On the other hand,
any point of $E$ is mapped to a point where the first $n + 1$ homogeneous
coordinates are all zero, in particular into the complement of $W$.
Moreover, it is clear that there is a factorization
$$
U = \varphi^{-1}(W) \xrightarrow{\varphi|_U}
W \xrightarrow{\text{pr}} \mathbf{P}^n_S
$$
of $\psi|_U$ where $\text{pr}$ is the projection using the first
$n + 1$ coordinates and $\psi : X \to \mathbf{P}^n_S$ is the embedding chosen
above. It follows that $\varphi|_U : U \to W$ is quasi-finite.

\medskip\noindent
Finally, we consider the map $\varphi|_E : E \to \mathbf{P}^{n + 1}_S$.
Observe that for any point $x \in E$ the image $\varphi(x)$
has its first $n + 1$ coordinates equal to zero, i.e., the morphism
$\varphi|_E$ factors through the closed subscheme
$\mathbf{P}^0_S \cong S$. The morphism $E \to S = \Spec(R)$
factors as $E \to \Spec(H^0(E, \mathcal{O}_E)) \to \Spec(R)$
by Schemes, Lemma \ref{schemes-lemma-morphism-into-affine}.
Since by assumption $H^0(E, \mathcal{O}_E)$ is a field we conclude
that $E$ maps to a point in $S \subset \mathbf{P}^{n + 1}_S$
which finishes the proof.
\end{proof}

\begin{lemma}
\label{lemma-contract-when-quasi-projective}
Let $S$ be a Noetherian scheme. Let $f : X \to S$ be a morphism of finite type.
Let $E \subset X$ be an exceptional curve of the first kind which is in a
fibre of $f$.
\begin{enumerate}
\item If $X$ is projective over $S$, then there exists a contraction
$X \to X'$ of $E$ and $X'$ is projective over $S$.
\item If $X$ is quasi-projective over $S$, then there exists a contraction
$X \to X'$ of $E$ and $X'$ is quasi-projective over $S$.
\end{enumerate}
\end{lemma}

\begin{proof}
Both cases follow from Lemma \ref{lemma-contract-ample}
using standard results on ample invertible modules and
(quasi-)projective morphisms.

\medskip\noindent
Proof of (2). Projectivity of $f$ means that $f$ is proper and there exists
an $f$-ample invertible module $\mathcal{L}$, see
Morphisms, Lemma \ref{morphisms-lemma-projective-is-quasi-projective-proper}
and Definition \ref{morphisms-definition-quasi-projective}.
Let $U \subset S$ be an affine open containing the image of $E$.
By Lemma \ref{lemma-contract-ample} there exists a contraction
$c : f^{-1}(U) \to V'$ of $E$ and an ample invertible module
$\mathcal{N}'$ on $V'$ whose pullback to $f^{-1}(U)$ is equal to
$\mathcal{L}(nE)|_{f^{-1}(U)}$. Let $v \in V'$ be the closed point
such that $c$ is the blowing up of $v$.
Then we can glue $V'$ and $X \setminus E$ along
$f^{-1}(U) \setminus E = V' \setminus \{v\}$
to get a scheme $X'$ over $S$. The morphisms $c$ and
$\text{id}_{X \setminus E}$ glue to a morphism $b : X \to X'$
which is the contraction of $E$. The inverse image of $U$ in $X'$
is proper over $U$. On the other hand, the restriction of $X' \to S$
to the complement of the image of $v$ in $S$ is isomorphic to the
restriction of $X \to S$ to that open. Hence $X' \to S$ is proper
(as being proper is local on the base by
Morphisms, Lemma \ref{morphisms-lemma-proper-local-on-the-base}).
Finally, $\mathcal{N}'$ and $\mathcal{L}|_{X \setminus E}$ restrict to
isomorphic invertible modules over $f^{-1}(U) \setminus E = V' \setminus \{v\}$
and hence glue to an invertible module $\mathcal{L}'$ over $X'$.
The restriction of $\mathcal{L}'$ to the inverse image of $U$
in $X'$ is ample because this is true for $\mathcal{N}'$.
For affine opens of $S$ avoiding the image of $v$, we see that
the same is true because it holds for $\mathcal{L}$.
Thus $\mathcal{L}'$ is $(X' \to S)$-relatively ample by
Morphisms, Lemma \ref{morphisms-lemma-characterize-relatively-ample}
and (2) is proved.

\medskip\noindent
Proof of (3). We can write $X$ as an open subscheme of a scheme
$\overline{X}$ projective over $S$ by Morphisms, Lemma
\ref{morphisms-lemma-quasi-projective-open-projective}.
By (2) there is a contraction $b : \overline{X} \to \overline{X}'$
and $\overline{X}'$ is projective over $S$. Then we let
$X' \subset \overline{X}$ be the image of $X \to \overline{X}'$;
this is an open as $b$ is an isomorphism away from $E$.
Then $X \to X'$ is the desired contraction. Note that
$X'$ is quasi-projective over $S$ as it has an
$S$-relatively ample invertible module
by the construction in the proof of part (2).
\end{proof}

\begin{lemma}
\label{lemma-regular-dim-2-quasi-projective}
Let $S$ be a Noetherian scheme. Let $f : X \to S$ be a
separated morphism of finite type with $X$ regular of dimension $2$.
Then $X$ is quasi-projective over $S$.
\end{lemma}

\begin{proof}
By Chow's lemma
(Cohomology of Schemes, Lemma \ref{coherent-lemma-chow-Noetherian})
there exists a proper morphism $\pi : X' \to X$ which is an isomorphism
over a dense open $U \subset X$ such that $X' \to S$ is H-quasi-projective.
By Lemma \ref{lemma-extend-rational-map-blowing-up}
there exists a sequence of blowups in closed points
$$
X_n \to \ldots \to X_1 \to X_0 = X
$$
and an $S$-morphism $X_n \to X'$ extending the rational map $U \to X'$.
Observe that $X_n \to X$ is projective by
Divisors, Lemma \ref{divisors-lemma-blowing-up-projective} and
Morphisms, Lemma \ref{morphisms-lemma-composition-projective}.
This implies that $X_n \to X'$ is projective by
Morphisms, Lemma \ref{morphisms-lemma-projective-permanence}.
Hence $X_n \to S$ is quasi-projective by
Morphisms, Lemma \ref{morphisms-lemma-composition-quasi-projective}
(and the fact that a projective morphism is quasi-projective, see
Morphisms, Lemma \ref{morphisms-lemma-projective-quasi-projective}).
By Lemma \ref{lemma-contract-when-quasi-projective}
(and uniqueness of contractions Lemma \ref{lemma-contraction-unique})
we conclude  that $X_{n - 1}, \ldots, X_0 = X$ are quasi-projective over $S$
as desired.
\end{proof}

\begin{lemma}
\label{lemma-regular-dim-2-projective}
Let $S$ be a Noetherian scheme. Let $f : X \to S$ be a
proper morphism with $X$ regular of dimension $2$.
Then $X$ is projective over $S$.
\end{lemma}

\begin{proof}
This follows from
Lemma \ref{lemma-regular-dim-2-quasi-projective} and
Morphisms, Lemma \ref{morphisms-lemma-projective-is-quasi-projective-proper}.
\end{proof}






\section{Factorization birational maps}
\label{section-factorizing}

\noindent
Proper birational morphisms between nonsingular surfaces are given by
sequences of quadratic transforms.

\begin{lemma}
\label{lemma-proper-birational-regular-surfaces}
Let $f : X \to Y$ be a proper birational morphism between
integral Noetherian schemes regular of dimension $2$.
Then $f$ is a sequence of blowups in closed points.
\end{lemma}

\begin{proof}
Let $V \subset Y$ be the maximal open over which $f$ is an isomorphism.
Then $V$ contains all codimension $1$ points of $V$ (Varieties,
Lemma \ref{varieties-lemma-modification-normal-iso-over-codimension-1}).
Let $y \in Y$ be a closed point not contained in $V$.
Then we want to show that $f$ factors through the blowup $b : Y' \to Y$
of $Y$ at $y$. Namely, if this is true, then at least one (and in fact
exactly one) component of the fibre $f^{-1}(y)$ will map isomorphically
onto the exceptional curve in $Y'$ and the number of curves
in fibres of $X \to Y'$ will be strictly less that the number of curves
in fibres of $X \to Y$, so we conclude by induction. Some details omitted.

\medskip\noindent
By Lemma \ref{lemma-extend-rational-map-blowing-up}
we know that there exists a sequence of blowing ups
$$
X' = X_n \to X_{n - 1} \to \ldots \to X_1 \to X_0 = X
$$
in closed points lying over the fibre $f^{-1}(y)$
and a morphism $X' \to Y'$ such that
$$
\xymatrix{
X' \ar[d]_{f'} \ar[r] & X \ar[d]^f \\
Y' \ar[r] & Y
}
$$
is commutative. We want to show that the morphism $X' \to Y'$
factors through $X$ and hence we can use induction on $n$ to
reduce to the case where $X' \to X$ is the blowup of $X$
in a closed point $x \in X$ mapping to $y$.

\medskip\noindent
Let $E \subset X'$ be the exceptional fibre of the blowing up
$X' \to X$. If $E$ maps to a point in $Y'$, then we obtain the
desired factorization by Lemma \ref{lemma-factor-through-contraction}.
We will prove that
if this is not the case we obtain a contradiction. Namely,
if $f'(E)$ is not a point, then
$E' = f'(E)$ must be the exceptional curve in $Y'$.
Picture
$$
\xymatrix{
E \ar[r] \ar[d]_g & X' \ar[d]_{f'} \ar[r] & X \ar[d]^f \\
E' \ar[r] & Y' \ar[r] & Y
}
$$
Arguing as before $f'$ is an isomorphism in an open neighbourhood
of the generic point of $E'$. Hence $g : E \to E'$ is a finite birational
morphism. Then the inverse of $g$ (a rational map) is everywhere defined
by Morphisms, Lemma \ref{morphisms-lemma-extend-across} and $g$ is
an isomorphism. Consider the map
$$
g^*\mathcal{C}_{E'/Y'} \longrightarrow \mathcal{C}_{E/X'}
$$
of Morphisms, Lemma \ref{morphisms-lemma-conormal-functorial}.
Since the source and target are invertible modules of degree $1$
on $E = E' = \mathbf{P}^1_\kappa$ and since the map is
nonzero (as $f'$ is an isomorphism in the generic point of $E$)
we conclude it is an isomorphism. By
Morphisms, Lemma \ref{morphisms-lemma-two-immersions}
we conclude that $\Omega_{X'/Y'}|_E = 0$.
This means that $f'$ is unramified at every point of $E$
(Morphisms, Lemma \ref{morphisms-lemma-unramified-at-point}).
Hence $f'$ is quasi-finite at every point of $E$
(Morphisms, Lemma \ref{morphisms-lemma-unramified-quasi-finite}).
Hence the maximal open $V' \subset Y'$ over which $f'$ is an
isomorphism contains $E'$ by Varieties, Lemma
\ref{varieties-lemma-modification-normal-iso-over-codimension-1}.
This in turn implies that the inverse image of $y$ in
$X'$ is $E'$. Hence the inverse image of $y$ in $X$ is $x$.
Hence $x \in X$ is in the maximal open over which
$f$ is an isomorphism by Varieties, Lemma
\ref{varieties-lemma-modification-normal-iso-over-codimension-1}.
This is a contradiction as we assumed that $y$ is not
in this open.
\end{proof}

\begin{lemma}
\label{lemma-birational-regular-surfaces}
Let $S$ be a Noetherian scheme. Let $X$ and $Y$ be proper
integral schemes over $S$ which are regular of dimension $2$.
Then $X$ and $Y$ are $S$-birational if and only if there
exists a diagram of $S$-morphisms
$$
X = X_0 \leftarrow X_1 \leftarrow \ldots \leftarrow X_n = Y_m
\to \ldots \to Y_1 \to Y_0 = Y
$$
where each morphism is a blowup in a closed point.
\end{lemma}

\begin{proof}
Let $U \subset X$ be open and let $f : U \to Y$ be the given
$S$-rational map (which is invertible as an $S$-rational map).
By Lemma \ref{lemma-extend-rational-map-blowing-up}
we can factor $f$ as $X_n \to \ldots \to X_1 \to X_0 = X$
and $f_n : X_n \to Y$. Since $X_n$ is proper over $S$ and
$Y$ separated over $S$ the morphism $f_n$ is proper.
Clearly $f_n$ is birational. Hence $f_n$ is a composition
of contractions by Lemma \ref{lemma-proper-birational-regular-surfaces}.
We omit the proof of the converse.
\end{proof}






\input{chapters}

\bibliography{my}
\bibliographystyle{amsalpha}

\end{document}
